pub struct ServiceServer { /* private fields */ }Expand description
Eidetica service server that listens on a Unix domain socket.
The server wraps a full Instance so it can dispatch both storage operations
(via the backend) and write callbacks (via Instance::put_entry()’s notification path).
CRDT-state caching lives in the underlying BackendImpl (scope-keyed
via crate::backend::CacheScope); wire handlers route through
instance.backend() directly rather than keeping a separate
service-layer cache.
Implementations§
Source§impl ServiceServer
impl ServiceServer
Sourcepub fn new(instance: Instance, socket_path: impl Into<PathBuf>) -> Self
pub fn new(instance: Instance, socket_path: impl Into<PathBuf>) -> Self
Create a new service server.
§Arguments
instance- The Instance to serve. The server holds a strong reference.socket_path- Path for the Unix domain socket.
Sourcepub fn socket_path(&self) -> &Path
pub fn socket_path(&self) -> &Path
Get the socket path.
Sourcepub async fn run(&self, shutdown: Receiver<()>) -> Result<()>
pub async fn run(&self, shutdown: Receiver<()>) -> Result<()>
Run the server until the shutdown signal is received.
Removes any stale socket file, creates the parent directory, binds the listener, and loops accepting connections. Each connection is handled in a spawned task. On shutdown, the socket file is cleaned up.
§Arguments
shutdown- A watch receiver; the server stops when the sender is dropped.
Auto Trait Implementations§
impl Freeze for ServiceServer
impl !RefUnwindSafe for ServiceServer
impl Send for ServiceServer
impl Sync for ServiceServer
impl Unpin for ServiceServer
impl UnsafeUnpin for ServiceServer
impl !UnwindSafe for ServiceServer
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
Mutably borrows from an owned value. Read more
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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