pub struct Daemon { /* private fields */ }Expand description
Owns the Iroh node, synchronization intents, IPC server, and daemon lifecycle state.
Implementations§
Source§impl Daemon
impl Daemon
Sourcepub fn endpoint(&self) -> Endpoint
pub fn endpoint(&self) -> Endpoint
Return a clone of the daemon’s iroh endpoint, useful for awaiting relay connectivity in tests.
Sourcepub async fn new(config: DaemonConfig) -> Result<Self>
pub async fn new(config: DaemonConfig) -> Result<Self>
Create a daemon, acquire its process lock, and persist its running state.
§Errors
Returns an error if another daemon owns the data directory, the node cannot be opened, or configuration cannot be parsed.
Sourcepub async fn run(&self) -> Result<()>
pub async fn run(&self) -> Result<()>
Run the daemon until IPC or operating-system shutdown is requested.
§Errors
Returns an error if an IPC listener, sync cycle, or cleanup operation fails.
Sourcepub async fn state(&self) -> DaemonState
pub async fn state(&self) -> DaemonState
Return a snapshot of the daemon lifecycle state.
Sourcepub fn archive_pool(&self) -> &ManagedPool
pub fn archive_pool(&self) -> &ManagedPool
Return the daemon’s fixed archive pool.
Sourcepub async fn is_in_active_window(&self) -> bool
pub async fn is_in_active_window(&self) -> bool
Return whether the global schedule is currently active.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Daemon
impl !RefUnwindSafe for Daemon
impl !UnwindSafe for Daemon
impl Send for Daemon
impl Sync for Daemon
impl Unpin for Daemon
impl UnsafeUnpin for Daemon
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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