pub struct Server { /* private fields */ }Expand description
Implementations§
Source§impl Server
impl Server
Sourcepub async fn new<T>(stream: T) -> Result<Self>
pub async fn new<T>(stream: T) -> Result<Self>
Creates an opaque-only VFS server over a bidirectional byte stream.
Sourcepub async fn new_split<R, W>(reader: R, writer: W) -> Result<Self>
pub async fn new_split<R, W>(reader: R, writer: W) -> Result<Self>
Creates an opaque-only VFS server on separate reader and writer streams.
Sourcepub async fn bind(path: impl AsRef<Path>) -> Result<Self>
Available on Unix only.
pub async fn bind(path: impl AsRef<Path>) -> Result<Self>
Binds a Unix-domain listener for VFS agent connections.
Sourcepub async fn bind_with_key(
path: impl AsRef<Path>,
key: Option<AuthKey>,
) -> Result<Self>
Available on Unix only.
pub async fn bind_with_key( path: impl AsRef<Path>, key: Option<AuthKey>, ) -> Result<Self>
Binds a Unix-domain listener that requires mutual proof of a pre-shared key from every connection.
The socket’s permissions cannot distinguish the intended client when
the peer’s uid is not knowable in advance; key is what does. A
connection that fails the check is dropped during negotiation, before
it can issue any request.
Sourcepub async fn from_named_pipe_client(pipe: NamedPipeClient) -> Result<Self>
Available on Windows only.
pub async fn from_named_pipe_client(pipe: NamedPipeClient) -> Result<Self>
Creates a VFS RPC server on the client end of a connected Windows named pipe.
Sourcepub async fn accept(self) -> Result<()>
Available on Unix only.
pub async fn accept(self) -> Result<()>
Accepts connections until a client requests server shutdown.
Each connection runs in an independent handler task. Routine client disconnects are ignored; unexpected handler failures are reported to standard error.
Sourcepub async fn accept_one<F>(self, established: F) -> Result<()>where
F: FnOnce(),
Available on Unix only.
pub async fn accept_one<F>(self, established: F) -> Result<()>where
F: FnOnce(),
Accepts connections until one completes negotiation, then serves that session alone.
established runs once, as soon as some connection has negotiated
successfully — the point at which the listening socket has done its job
and the caller can unlink it. Nothing is accepted afterwards.
Connections that fail to negotiate (including failing authentication) are dropped and do not consume the single slot, so an impostor that reaches the socket first cannot deny the intended client its session; it can only waste an attempt. Negotiation has a timeout and a fixed limit on in-flight attempts, so a peer that connects and then says nothing cannot stall or crowd out the real one either.
Auto Trait Implementations§
impl !Freeze for Server
impl !RefUnwindSafe for Server
impl !Sync for Server
impl !UnwindSafe for Server
impl Send for Server
impl Unpin for Server
impl UnsafeUnpin for Server
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> 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