pub struct Local<Op> { /* private fields */ }Expand description
A wire whose payload is the request and whose frames are the reply’s steps, for an operation whose events the runtime builds itself.
The transport is the runtime: it implements Transport<Local<Op>>,
takes the request and delivers the reply’s Steps, ending with the
operation’s end. A runtime that stops without it leaves the reply
truncated. A failure that ends the reply is the transport’s own Err.
Implementations§
Source§impl<Op: Operation<Emit = Free>> Local<Op>
impl<Op: Operation<Emit = Free>> Local<Op>
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
A wire named name (as records and telemetry name it), addressing
no model id, with default capabilities.
Sourcepub fn with_capabilities(self, capabilities: Capabilities) -> Self
pub fn with_capabilities(self, capabilities: Capabilities) -> Self
What a runtime accounts for, such as an embedding width.
Trait Implementations§
Source§impl Transport<Local<Embedding>> for MockEmbeddings
Available on crate feature test-utils only.
impl Transport<Local<Embedding>> for MockEmbeddings
Available on crate feature
test-utils only.Source§fn send(
&self,
texts: Vec<String>,
_exchange: Exchange,
) -> Opening<Step<Embedding>> ⓘ
fn send( &self, texts: Vec<String>, _exchange: Exchange, ) -> Opening<Step<Embedding>> ⓘ
Open the reply to one payload. Nothing is sent until the opening is
first polled. A payload the transport cannot send in the exchange’s
mode fails the opening; a failure after the reply opened is its last
frame.
Source§impl<Op: Operation<Emit = Free>> Wire for Local<Op>
impl<Op: Operation<Emit = Free>> Wire for Local<Op>
Source§type Payload = <Op as Operation>::Request
type Payload = <Op as Operation>::Request
What
Self::encode produces for the transport to send.Source§type Reassembler = Unreassembled
type Reassembler = Unreassembled
What rebuilds a reply’s provider document from its frames when the
transport reports no whole document, as for a stream. The driver
feeds it every frame and records what it finishes with as
raw.
A wire whose operation’s decoders record raw themselves names
document::Unreassembled; a completion wire cannot, because it
does not Serve completions.Source§fn describe(&self) -> Descriptor<'_>
fn describe(&self) -> Descriptor<'_>
What the wire says about itself.
Source§fn encode(
&self,
request: Op::Request,
_mode: Mode,
) -> Result<Op::Request, EncodeError>
fn encode( &self, request: Op::Request, _mode: Mode, ) -> Result<Op::Request, EncodeError>
The request to send. Pure: it may read
self, request and mode,
and nothing else. A request that cannot be built is an
EncodeError, which always reports as a request failure.Source§fn reassembler(&self) -> Self::Reassembler
fn reassembler(&self) -> Self::Reassembler
A fresh reassembler for one reply. A wire that picks its API per
reply builds the matching one.
Auto Trait Implementations§
impl<Op> Freeze for Local<Op>
impl<Op> RefUnwindSafe for Local<Op>
impl<Op> Send for Local<Op>
impl<Op> Sync for Local<Op>
impl<Op> Unpin for Local<Op>
impl<Op> UnsafeUnpin for Local<Op>
impl<Op> UnwindSafe for Local<Op>
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<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