-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resetting how we invoke bindgen, which solved the linking issues
- Loading branch information
Showing
9 changed files
with
1,357 additions
and
1,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ build/ | |
.ffisymbol-graphs | ||
*_identifiers.txt | ||
*_symbols.txt | ||
.vscode | ||
|
||
Cargo.lock | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
// snippet.establishDocuments | ||
import YSwift | ||
|
||
let localDocument = YDocument() | ||
let localText = localDocument.getOrCreateText(named: "example") | ||
localDocument.transactSync { txn in | ||
localText.append("hello, world!", in: txn) | ||
} | ||
|
||
let remoteDocument = YDocument() | ||
let remoteText = remoteDocument.getOrCreateText(named: "example") | ||
// snippet.end | ||
|
||
// snippet.displayTextFromDocuments | ||
localDocument.transactSync { txn in | ||
print("local document text from `example`: \"\(localText.getString(in: txn))\"") | ||
} | ||
|
||
remoteDocument.transactSync { txn in | ||
print("remote document text from `example`: \"\(remoteText.getString(in: txn))\"") | ||
} | ||
|
||
// snippet.end | ||
|
||
// snippet.syncDocuments | ||
print(" --> Synchronizing local to remote") | ||
let remoteState = remoteDocument.transactSync { txn in | ||
txn.transactionStateVector() | ||
} | ||
|
||
print(" . Size of the remote state is \(remoteState.count) bytes.") | ||
let updateRemote = localDocument.transactSync { txn in | ||
localDocument.diff(txn: txn, from: remoteState) | ||
} | ||
|
||
print(" . Size of the diff from remote state is \(updateRemote.count) bytes.") | ||
remoteDocument.transactSync { txn in | ||
try! txn.transactionApplyUpdate(update: updateRemote) | ||
} | ||
|
||
// snippet.end | ||
|
||
// Synchronization complete, read out results into local variables | ||
|
||
// snippet.captureAndDisplaySyncedData | ||
let localString = localDocument.transactSync { txn in | ||
localText.getString(in: txn) | ||
} | ||
|
||
let remoteString = remoteDocument.transactSync { txn in | ||
remoteText.getString(in: txn) | ||
} | ||
|
||
print("local document text from `example`: \"\(localString)\"") | ||
print("remote document text from `example`: \"\(remoteString)\"") | ||
// snippet.end | ||
// // snippet.establishDocuments | ||
// import YSwift | ||
|
||
// let localDocument = YDocument() | ||
// let localText = localDocument.getOrCreateText(named: "example") | ||
// localDocument.transactSync { txn in | ||
// localText.append("hello, world!", in: txn) | ||
// } | ||
|
||
// let remoteDocument = YDocument() | ||
// let remoteText = remoteDocument.getOrCreateText(named: "example") | ||
// // snippet.end | ||
|
||
// // snippet.displayTextFromDocuments | ||
// localDocument.transactSync { txn in | ||
// print("local document text from `example`: \"\(localText.getString(in: txn))\"") | ||
// } | ||
|
||
// remoteDocument.transactSync { txn in | ||
// print("remote document text from `example`: \"\(remoteText.getString(in: txn))\"") | ||
// } | ||
|
||
// // snippet.end | ||
|
||
// // snippet.syncDocuments | ||
// print(" --> Synchronizing local to remote") | ||
// let remoteState = remoteDocument.transactSync { txn in | ||
// txn.transactionStateVector() | ||
// } | ||
|
||
// print(" . Size of the remote state is \(remoteState.count) bytes.") | ||
// let updateRemote = localDocument.transactSync { txn in | ||
// localDocument.diff(txn: txn, from: remoteState) | ||
// } | ||
|
||
// print(" . Size of the diff from remote state is \(updateRemote.count) bytes.") | ||
// remoteDocument.transactSync { txn in | ||
// try! txn.transactionApplyUpdate(update: updateRemote) | ||
// } | ||
|
||
// // snippet.end | ||
|
||
// // Synchronization complete, read out results into local variables | ||
|
||
// // snippet.captureAndDisplaySyncedData | ||
// let localString = localDocument.transactSync { txn in | ||
// localText.getString(in: txn) | ||
// } | ||
|
||
// let remoteString = remoteDocument.transactSync { txn in | ||
// remoteText.getString(in: txn) | ||
// } | ||
|
||
// print("local document text from `example`: \"\(localString)\"") | ||
// print("remote document text from `example`: \"\(remoteString)\"") | ||
// // snippet.end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.