pub struct Server<C, I, O, H = ()> { /* private fields */ }Expand description
wRPC server for framed transports
Implementations§
Trait Implementations§
Source§impl<C, I, O, H> Serve for Server<C, I, O, H>
impl<C, I, O, H> Serve for Server<C, I, O, H>
Source§async fn serve(
&self,
instance: &str,
func: &str,
paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send,
) -> Result<impl Stream<Item = Result<(<Server<C, I, O, H> as Serve>::Context, <Server<C, I, O, H> as Serve>::Outgoing, <Server<C, I, O, H> as Serve>::Incoming), Error>> + 'static, Error>
async fn serve( &self, instance: &str, func: &str, paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send, ) -> Result<impl Stream<Item = Result<(<Server<C, I, O, H> as Serve>::Context, <Server<C, I, O, H> as Serve>::Outgoing, <Server<C, I, O, H> as Serve>::Incoming), Error>> + 'static, Error>
Serve function
func from instance instanceSource§impl<C, I, O, H> Serve for &Server<C, I, O, H>
impl<C, I, O, H> Serve for &Server<C, I, O, H>
Source§async fn serve(
&self,
instance: &str,
func: &str,
paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send,
) -> Result<impl Stream<Item = Result<(<&Server<C, I, O, H> as Serve>::Context, <&Server<C, I, O, H> as Serve>::Outgoing, <&Server<C, I, O, H> as Serve>::Incoming), Error>> + 'static, Error>
async fn serve( &self, instance: &str, func: &str, paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send, ) -> Result<impl Stream<Item = Result<(<&Server<C, I, O, H> as Serve>::Context, <&Server<C, I, O, H> as Serve>::Outgoing, <&Server<C, I, O, H> as Serve>::Incoming), Error>> + 'static, Error>
Serve function
func from instance instanceAuto Trait Implementations§
impl<C, I, O, H = ()> !Freeze for Server<C, I, O, H>
impl<C, I, O, H = ()> !RefUnwindSafe for Server<C, I, O, H>
impl<C, I, O, H> Send for Server<C, I, O, H>
impl<C, I, O, H> Sync for Server<C, I, O, H>
impl<C, I, O, H> Unpin for Server<C, I, O, H>where
H: Unpin,
impl<C, I, O, H> UnsafeUnpin for Server<C, I, O, H>
impl<C, I, O, H> UnwindSafe for Server<C, I, O, H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServeExt for Twhere
T: Serve,
impl<T> ServeExt for Twhere
T: Serve,
Source§fn serve_values<Params, Results>(
&self,
instance: &str,
func: &str,
paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send,
) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Params, Option<impl Future<Output = Result<(), Error>> + Send + Unpin + 'static>, impl FnOnce(Results) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Send + 'static), Error>> + Send + 'static, Error>> + Sendwhere
Params: TupleDecode<Self::Incoming> + Send + 'static,
Results: TupleEncode<Self::Outgoing> + Send + 'static,
<<Params as Decode<Self::Incoming>>::Decoder as Decoder>::Error: Error + Send + Sync + 'static,
<<Results as Encode<Self::Outgoing>>::Encoder as Encoder<Results>>::Error: Error + Send + Sync + 'static,
fn serve_values<Params, Results>(
&self,
instance: &str,
func: &str,
paths: impl Into<Arc<[Box<[Option<usize>]>]>> + Send,
) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Params, Option<impl Future<Output = Result<(), Error>> + Send + Unpin + 'static>, impl FnOnce(Results) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Send + 'static), Error>> + Send + 'static, Error>> + Sendwhere
Params: TupleDecode<Self::Incoming> + Send + 'static,
Results: TupleEncode<Self::Outgoing> + Send + 'static,
<<Params as Decode<Self::Incoming>>::Decoder as Decoder>::Error: Error + Send + Sync + 'static,
<<Results as Encode<Self::Outgoing>>::Encoder as Encoder<Results>>::Error: Error + Send + Sync + 'static,
Serve function
func from instance instance using typed Params and ResultsSource§impl<T> ServeExt for Twhere
T: Serve,
impl<T> ServeExt for Twhere
T: Serve,
Source§fn serve_function<T>(
&self,
store: impl Fn() -> Store<T> + Send + 'static,
instance_pre: InstancePre<T>,
host_resources: impl Into<Arc<HashMap<Box<str>, HashMap<Box<str>, (ResourceType, ResourceType)>>>>,
ty: ComponentFunc,
instance_name: &str,
name: &str,
) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>), Error>> + Send + 'static, Error>> + Send
fn serve_function<T>( &self, store: impl Fn() -> Store<T> + Send + 'static, instance_pre: InstancePre<T>, host_resources: impl Into<Arc<HashMap<Box<str>, HashMap<Box<str>, (ResourceType, ResourceType)>>>>, ty: ComponentFunc, instance_name: &str, name: &str, ) -> impl Future<Output = Result<impl Stream<Item = Result<(Self::Context, Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>), Error>> + Send + 'static, Error>> + Send
Serve
types::ComponentFunc from an InstancePre instantiating it on each call.
This serving method does not support guest-exported resources.Like
Self::serve_function, but with a shared store instance.
This is required to allow for serving functions, which operate on guest-exported resources.