pub struct SyncState {
pub positions: PositionMap,
pub collaborators: Vec<Collaborator>,
pub posted_replies: Vec<PostedReply>,
pub projection_hash: Option<String>,
}Expand description
The decoded ** Sync State contents.
Fields§
§positions: PositionMapWhere each anchorable element landed in the projected doc (P3 output).
collaborators: Vec<Collaborator>Reviewers seen on pulled comments.
posted_replies: Vec<PostedReply>Operator replies already posted to Google (push idempotence).
projection_hash: Option<String>Fingerprint of the projection last pushed to Google
(crate::project::Projection::fingerprint). A re-push with a matching
fingerprint skips the full-replace so existing comment anchors survive.
Implementations§
Source§impl SyncState
impl SyncState
Sourcepub fn reply_posted(&self, comment_id: &str, content: &str) -> bool
pub fn reply_posted(&self, comment_id: &str, content: &str) -> bool
Whether a reply with this comment_id + content has already been posted.
Source§impl SyncState
impl SyncState
Sourcepub fn render_block(&self) -> String
pub fn render_block(&self) -> String
Render the full ** Sync State subtree (heading + source block).
Sourcepub fn parse_block(region: &str) -> Result<Self>
pub fn parse_block(region: &str) -> Result<Self>
Parse a SyncState from a region that may contain the ** Sync State
block (e.g. the whole * GDOC_METADATA machine region).
A region without the block decodes to SyncState::default.
§Errors
Returns Error::Sexp when the block is present but its s-expression is
malformed or does not match the schema.
Trait Implementations§
impl Eq for SyncState
impl StructuralPartialEq for SyncState
Auto Trait Implementations§
impl Freeze for SyncState
impl RefUnwindSafe for SyncState
impl Send for SyncState
impl Sync for SyncState
impl Unpin for SyncState
impl UnsafeUnpin for SyncState
impl UnwindSafe for SyncState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.