pub struct Bootstrap { /* private fields */ }Expand description
Whether this device still waits for its first snapshot from the device that paired it, so nothing is ingested before it holds the identity’s rows. The state lives in the store; this caches it so ingest paths can check it without a query.
Implementations§
Source§impl Bootstrap
impl Bootstrap
pub fn load(sqlite: &SqliteStore) -> Result<Self>
Sourcepub fn start(sqlite: &SqliteStore, data_dir: &Path) -> Self
pub fn start(sqlite: &SqliteStore, data_dir: &Path) -> Self
The daemon’s own at start: load, after sb setup’s join marker in
data_dir holds an empty store pending (and is then removed). A
state it cannot read holds ingest back rather than risk ingesting
before a bootstrap; founding an identity or a finished join ends it.
pub fn is_pending(&self) -> bool
Sourcepub fn ingest_due(&self) -> bool
pub fn ingest_due(&self) -> bool
The bootstrap finished and the full ingest pass after it has not.
pub fn mark_pending(&self, sqlite: &SqliteStore) -> Result<()>
Sourcepub fn finish(&self, sqlite: &SqliteStore) -> Result<bool>
pub fn finish(&self, sqlite: &SqliteStore) -> Result<bool>
Ends a pending bootstrap; true when one was pending.
Sourcepub fn cancel(&self, sqlite: &SqliteStore) -> Result<bool>
pub fn cancel(&self, sqlite: &SqliteStore) -> Result<bool>
Ends a pending bootstrap with no ingest pass due, as when this device founds its own identity instead of joining one; true when one was pending.
Sourcepub fn ingest_done(&self, sqlite: &SqliteStore) -> Result<()>
pub fn ingest_done(&self, sqlite: &SqliteStore) -> Result<()>
Records the full ingest pass as run; a no-op unless one was due, so a bootstrap marked pending meanwhile stays pending.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Bootstrap
impl Forget for Bootstrap
impl Move for Bootstrap
impl RefUnwindSafe for Bootstrap
impl Send for Bootstrap
impl Sync for Bootstrap
impl Unpin for Bootstrap
impl UnsafeUnpin for Bootstrap
impl UnwindSafe for Bootstrap
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().