pub struct MountBackend { /* private fields */ }Expand description
A Backend backed by a single Subject-scoped VFS [Mount].
The session [Subject] is either fixed at construction (MountBackend::new,
the UDS/vsock listeners) or resolved from the client’s Tattach.uname ticket
at attach time (MountBackend::with_authorizer, the H1b /9p WebTransport
plane). It lives behind a [OnceCell] so per-op code reads one bound value
either way; ops before a successful attach fail closed.
Implementations§
Source§impl MountBackend
impl MountBackend
Sourcepub fn new(mount: Arc<dyn Mount>, subject: Subject) -> Self
pub fn new(mount: Arc<dyn Mount>, subject: Subject) -> Self
Wrap mount as the 9P export root for a subject fixed at construction.
Wrap mount as the 9P export root whose session [Subject] is resolved
from the Tattach.uname ticket by authorizer (H1b /9p WebTransport).
The Subject is unbound until a successful Backend::attach; any op
arriving before attach fails closed.
Trait Implementations§
Source§impl Backend for MountBackend
impl Backend for MountBackend
Source§fn attach<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uname: &'life1 str,
aname: &'life2 str,
verified: Option<VerifiedAttach>,
) -> Pin<Box<dyn Future<Output = Result<Option<VerifiedAttach>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn attach<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uname: &'life1 str,
aname: &'life2 str,
verified: Option<VerifiedAttach>,
) -> Pin<Box<dyn Future<Output = Result<Option<VerifiedAttach>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Establish the session at
Tattach, given the uname the client
presented and the aname export selector it requested. The default is a
no-op: backends whose caller identity is fixed at construction
(the UDS/vsock listeners) ignore both. Read moreSource§fn walk<'life0, 'life1, 'async_trait>(
&'life0 self,
fid: u32,
newfid: u32,
components: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<WalkResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn walk<'life0, 'life1, 'async_trait>(
&'life0 self,
fid: u32,
newfid: u32,
components: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<WalkResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Walk
components from fid (the previously-walked parent, or the
attach root). Allocates internal state for newfid.Source§fn open<'life0, 'async_trait>(
&'life0 self,
fid: u32,
flags: u32,
) -> Pin<Box<dyn Future<Output = Result<OpenResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open<'life0, 'async_trait>(
&'life0 self,
fid: u32,
flags: u32,
) -> Pin<Box<dyn Future<Output = Result<OpenResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open
fid with Linux-style flags (Tlopen). Returns the leaf qid
and the negotiated iounit.Source§fn read<'life0, 'async_trait>(
&'life0 self,
fid: u32,
offset: u64,
count: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read<'life0, 'async_trait>(
&'life0 self,
fid: u32,
offset: u64,
count: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read up to
count bytes from fid at offset.Source§fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
fid: u32,
offset: u64,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
fid: u32,
offset: u64,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write
data to fid at offset. Returns the number of bytes written.Source§fn stat<'life0, 'async_trait>(
&'life0 self,
fid: u32,
) -> Pin<Box<dyn Future<Output = Result<StatResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stat<'life0, 'async_trait>(
&'life0 self,
fid: u32,
) -> Pin<Box<dyn Future<Output = Result<StatResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stat
fid.Source§fn readdir<'life0, 'async_trait>(
&'life0 self,
fid: u32,
offset: u64,
count: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readdir<'life0, 'async_trait>(
&'life0 self,
fid: u32,
offset: u64,
count: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List directory entries under
fid (a directory). The returned bytes
are 9P readdir records; the translator passes them through verbatim.Source§fn clunk<'life0, 'async_trait>(
&'life0 self,
fid: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clunk<'life0, 'async_trait>(
&'life0 self,
fid: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Release
fid. Best-effort — errors are logged and ignored by the
translator (the fid is dropped from its table regardless).Source§fn close_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Release connection-local handles after EOF or a framing/write error.
Backends without retained remote handles may keep the default no-op.
Auto Trait Implementations§
impl !Freeze for MountBackend
impl !RefUnwindSafe for MountBackend
impl Send for MountBackend
impl Sync for MountBackend
impl Unpin for MountBackend
impl UnsafeUnpin for MountBackend
impl !UnwindSafe for MountBackend
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> 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more