pub struct OplogContentSyncStore<'a> { /* private fields */ }Expand description
A SyncStore over one account’s OWN /3 content on a live connection (phase D, #406) — the
memories themselves, where OplogSyncStore moves the account log that authorizes them.
Scoped to a single account, like the account-log store: a session restores the account’s own
memories onto a fresh sibling. Content authored by OTHER accounts (shared streams) is a later
slice (#407) and is refused here. Received bytes go through content_ingest, which
re-resolves the roster key and re-verifies the signature from scratch — the transport adds no
trust.
Run this AFTER an account-log session in the same restore: content_ingest needs the roster and
grant material the account log carries to ACCEPT (rather than park) a candidate, so the account
authority must be in place first. A content session run before authority lands still transfers
every byte — it just parks candidates that a later settle promotes once authority arrives.
Implementations§
Source§impl<'a> OplogContentSyncStore<'a>
impl<'a> OplogContentSyncStore<'a>
pub fn new(conn: &'a Connection, account_id: AccountId, now_ms: i64) -> Self
Trait Implementations§
Source§impl NodeAuth for OplogContentSyncStore<'_>
impl NodeAuth for OplogContentSyncStore<'_>
Source§fn local_binding(&self, local_node: &[u8; 32], now_ms: i64) -> Result<Vec<u8>>
fn local_binding(&self, local_node: &[u8; 32], now_ms: i64) -> Result<Vec<u8>>
local_node is this account’s local device, stamped
now_ms. Err if this store cannot authorize (e.g. no local account/device yet — the
onboarding case).binding authorizes a peer whose iroh-authenticated node key is remote_node,
judged fresh against now_ms. Returns a plain bool — the store collapses the internal
failure taxonomy so the wire stays uniform. Err is reserved for a real fault (e.g. the
DB read failed), not a rejected peer.Source§impl SyncStore for OplogContentSyncStore<'_>
impl SyncStore for OplogContentSyncStore<'_>
Source§fn account_id(&self) -> [u8; 32]
fn account_id(&self) -> [u8; 32]
Source§fn snapshot(&self) -> Result<Vec<([u8; 32], Vec<u8>)>>
fn snapshot(&self) -> Result<Vec<([u8; 32], Vec<u8>)>>
(dedup_key, signed_bytes), read ONCE at session start. The
key is the SIGNED-envelope hash (sha256(signed_bytes)), NOT the entry_hash — two envelopes
can share an entry_hash but differ in signature, and the wire must treat them as distinct or
a peer holding one would suppress the other. Snapshotting up front keeps what we send
independent of what we concurrently ingest, so the two session halves never contend.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for OplogContentSyncStore<'a>
impl<'a> !Send for OplogContentSyncStore<'a>
impl<'a> !Sync for OplogContentSyncStore<'a>
impl<'a> !UnwindSafe for OplogContentSyncStore<'a>
impl<'a> Freeze for OplogContentSyncStore<'a>
impl<'a> Unpin for OplogContentSyncStore<'a>
impl<'a> UnsafeUnpin for OplogContentSyncStore<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more