pub struct IpcServer { /* private fields */ }Expand description
A server for the daemon’s local control channel.
Implementations§
Source§impl IpcServer
impl IpcServer
pub const fn new(socket_path: PathBuf, daemon_handle: DaemonHandle) -> Self
Sourcepub fn with_archive_context(
socket_path: PathBuf,
daemon_handle: DaemonHandle,
node: Arc<IrohNode>,
pool: Arc<ManagedPool>,
) -> Self
pub fn with_archive_context( socket_path: PathBuf, daemon_handle: DaemonHandle, node: Arc<IrohNode>, pool: Arc<ManagedPool>, ) -> Self
Create an IPC server with access to daemon-owned archive resources.
Sourcepub fn with_folder_manager(self, folder_manager: FolderManager) -> Self
pub fn with_folder_manager(self, folder_manager: FolderManager) -> Self
Set the folder manager for this IPC server.
Sourcepub fn with_node_db(self, node_db: NodeDatabase) -> Self
pub fn with_node_db(self, node_db: NodeDatabase) -> Self
Set the node database for persistence.
Sourcepub fn with_resilience(self, resilience: ResilienceService) -> Self
pub fn with_resilience(self, resilience: ResilienceService) -> Self
Attach a resilience service for live peer-count queries.
Sourcepub fn with_network_manager(
self,
network_manager: Arc<RwLock<NetworkManager>>,
) -> Self
pub fn with_network_manager( self, network_manager: Arc<RwLock<NetworkManager>>, ) -> Self
Attach a network manager for daemon-side network operations.
Sourcepub async fn serve(&self) -> Result<()>
pub async fn serve(&self) -> Result<()>
Accept and process requests until the daemon broadcasts shutdown.
§Errors
Returns an error when the socket cannot be bound, accepted, or written.
Sourcepub async fn handle_request(&self, request: IpcRequest) -> IpcResponse
pub async fn handle_request(&self, request: IpcRequest) -> IpcResponse
Handle one decoded request without requiring a socket.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for IpcServer
impl !UnwindSafe for IpcServer
impl Freeze for IpcServer
impl Send for IpcServer
impl Sync for IpcServer
impl Unpin for IpcServer
impl UnsafeUnpin for IpcServer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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