pub struct ModelBackend { /* private fields */ }Expand description
Backend impl that proxies 9P operations to the model service.
Holds a single-threaded tokio runtime to drive the async client, mirroring
RemoteModelMount. If the model service is unreachable, calls return
anyhow::Error and the translator surfaces an Rlerror.
Implementations§
Source§impl ModelBackend
impl ModelBackend
Sourcepub fn new(client: ModelClient) -> Self
pub fn new(client: ModelClient) -> Self
Wrap a ModelClient. The client must already be configured to talk to
the model service (signing key, server verifying key, subject).
Trait Implementations§
Source§impl Backend for ModelBackend
impl Backend for ModelBackend
Source§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 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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: '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 close_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn close_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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 ModelBackend
impl !RefUnwindSafe for ModelBackend
impl Send for ModelBackend
impl Sync for ModelBackend
impl Unpin for ModelBackend
impl UnsafeUnpin for ModelBackend
impl !UnwindSafe for ModelBackend
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> JaggedSlice<T> for T
impl<T> JaggedSlice<T> for T
§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