Expand description
MACRO-13 · what a trait the activation macro emits leans on.
#[plexus_macros::activation(trait)] on impl FooActivation emits
trait Foo: every wire method as fn(&self, ..) -> BoxStream<'static, E>,
implemented by the activation and by FooClient<T>. A client call is a
stream of Result<E, ClientError> (RETURNS-9’s MethodStream, progress
already dropped); a trait method is a stream of E. This module is the
bridge:
FromClientError— how a client failure becomes the event type’s own in-band error (one line, usuallyError { message }), so a caller ofdyn Foosees one shape whether it is talking to a local implementation or a remote one;owned_call— a'staticcall from an owned transport, since a trait method’s stream outlives the&selfit was called on;into_events/error_events— the mapping itself: an item is yielded, an error is yielded asE::from_client_error(err)and ends the stream.
RETURNS-36: the trait is always emitted, each method under its own return
type: a one-item method’s is a BoxFuture of its item, a stream form’s a
BoxStream of its items. trait_one, trait_many,
trait_progress and trait_result_progress are the client half’s.
Traits§
- From
Client Error - An event type that can carry a client failure in band.
- Maybe
Send Sendoff wasm32, nothing on it: the bound a trait’s client half puts on what it moves into a boxed future or stream.
Functions§
- error_
events - A trait method’s stream that yields
E::from_client_error(error)and ends — what an emitted client method returns when a parameter would not serialize. - into_
events - A typed client stream as a trait method’s stream: data events yielded,
progress dropped, the first error yielded as
E::from_client_error(err)and the stream ended there. - owned_
call Transport::callon a transport the stream owns, so the stream is'static: a trait method returns a stream that outlives the&selfit was called on, andTransport::callborrows its transport.- owned_
call_ raw owned_callfor a typed client:Transport::call_rawon a transport the stream owns (PERF.115-36).- owned_
call_ raw_ with_ input - BIDIR-6:
owned_call_raw, for a method with an input half. - trait_
many -> impl Stream<Item = T>/Item = Result<T, E>: many items.- trait_
one -> T/-> Result<T, E>: one item.- trait_
one_ with_ input - BIDIR-6:
trait_one, for a method with an input half. - trait_
progress -> impl Stream<Item = Progress<T, P>>: items and progress updates.- trait_
result_ progress -> impl Stream<Item = Result<Progress<T, P>, E>>.
Type Aliases§
- BoxFuture
- A boxed future of
T— what a one-item method of an emitted trait returns (RETURNS-36).Sendoff wasm32, asBoxStreamis. - BoxStream
- A boxed stream of
T— the return type of every method of a trait the activation macro emits.Sendoff wasm32, asItemStreamis; on wasm32 the browser’s futures are!Send, so the bound is dropped.