pub struct InProcessTransport<A> { /* private fields */ }Expand description
A Transport backed directly by one Activation.
ⓘ
let client = TicketsClient::new(InProcessTransport::new(Tickets::new(store)));
let health = client.health().await?; // one item
let tickets: Vec<_> = client.list(None, None).try_collect().await?; // manyImplementations§
Source§impl<A: Activation> InProcessTransport<A>
impl<A: Activation> InProcessTransport<A>
Sourcepub fn with_auth(activation: A, auth: AuthContext) -> Self
pub fn with_auth(activation: A, auth: AuthContext) -> Self
Dispatch with an auth context attached to every call — the equivalent of a transport carrying a session cookie.
Sourcepub fn activation(&self) -> &A
pub fn activation(&self) -> &A
Borrow the activation, e.g. to assert on server-side state after a call.
Trait Implementations§
Source§impl<A: Clone> Clone for InProcessTransport<A>
impl<A: Clone> Clone for InProcessTransport<A>
Source§impl<A: Debug> Debug for InProcessTransport<A>
impl<A: Debug> Debug for InProcessTransport<A>
Source§impl<A: Activation> Transport for InProcessTransport<A>
impl<A: Activation> Transport for InProcessTransport<A>
fn call(&self, method: MethodRef, params: Value) -> ItemStream<'_>
Source§fn call_raw(
&self,
method: MethodRef,
params: Value,
) -> Pin<Box<dyn Stream<Item = Result<RawItem, TransportError>> + Send + '_>>
fn call_raw( &self, method: MethodRef, params: Value, ) -> Pin<Box<dyn Stream<Item = Result<RawItem, TransportError>> + Send + '_>>
call for a typed client (PERF.115-36): the same items,
each data item’s content still the wire’s JSON, which
decode_raw decodes straight into the method’s
event. The default is call’s items, each content the Value it
carries; a transport that has the wire’s text (WsTransport) hands it
over unread.Source§fn call_with_input<'a>(
&'a self,
method: MethodRef,
params: Value,
input: Pin<Box<dyn Stream<Item = Result<InputItem, TransportError>> + Send + 'a>>,
) -> Pin<Box<dyn Stream<Item = Result<StreamItem, TransportError>> + Send + 'a>>
fn call_with_input<'a>( &'a self, method: MethodRef, params: Value, input: Pin<Box<dyn Stream<Item = Result<InputItem, TransportError>> + Send + 'a>>, ) -> Pin<Box<dyn Stream<Item = Result<StreamItem, TransportError>> + Send + 'a>>
BIDIR-6:
call, for a method with an input half:
input is sent as the call runs, under the callee’s credit, and ended
when it ends. A transport that carries no input half (the default)
says so in the one item it yields: the call does not hang.Source§fn call_raw_with_input<'a>(
&'a self,
method: MethodRef,
params: Value,
input: Pin<Box<dyn Stream<Item = Result<InputItem, TransportError>> + Send + 'a>>,
) -> Pin<Box<dyn Stream<Item = Result<RawItem, TransportError>> + Send + 'a>>
fn call_raw_with_input<'a>( &'a self, method: MethodRef, params: Value, input: Pin<Box<dyn Stream<Item = Result<InputItem, TransportError>> + Send + 'a>>, ) -> Pin<Box<dyn Stream<Item = Result<RawItem, TransportError>> + Send + 'a>>
BIDIR-6:
call_raw, for a method with an input
half: what a typed client’s method with an Input calls. The default
is call_with_input’s items, each content
the Value it carries.Auto Trait Implementations§
impl<A> Forget for InProcessTransport<A>
impl<A> Freeze for InProcessTransport<A>where
A: Freeze,
impl<A> Move for InProcessTransport<A>
impl<A> RefUnwindSafe for InProcessTransport<A>where
A: RefUnwindSafe,
impl<A> Send for InProcessTransport<A>where
A: Send,
impl<A> Sync for InProcessTransport<A>where
A: Sync,
impl<A> Unpin for InProcessTransport<A>where
A: Unpin,
impl<A> UnsafeUnpin for InProcessTransport<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for InProcessTransport<A>where
A: UnwindSafe,
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