Struct ServeInner
pub struct ServeInner<D = DefaultFuchsiaResourceDialect>where
D: ResourceDialect,{ /* private fields */ }
Expand description
A type used from the innards of server implementations.
Implementations§
§impl<D> ServeInner<D>where
D: ResourceDialect,
impl<D> ServeInner<D>where
D: ResourceDialect,
pub fn new(channel: <D as ResourceDialect>::ProxyChannel) -> ServeInner<D>
pub fn new(channel: <D as ResourceDialect>::ProxyChannel) -> ServeInner<D>
Creates a new set of server innards.
pub fn channel(
&self,
) -> &<<D as ResourceDialect>::ProxyChannel as ProxyChannelFor<D>>::Boxed
pub fn channel( &self, ) -> &<<D as ResourceDialect>::ProxyChannel as ProxyChannelFor<D>>::Boxed
Gets a reference to the inner channel.
pub fn into_channel(self) -> <D as ResourceDialect>::ProxyChannel
pub fn into_channel(self) -> <D as ResourceDialect>::ProxyChannel
Converts the [ServerInner
] back into a channel.
Warning: This operation is dangerous, since the returned channel could have unread messages intended for this server. Use it carefully.
pub fn shutdown(&self)
pub fn shutdown(&self)
Sets the server to shutdown the next time the stream is polled.
TODO(https://fxbug.dev/42153903): This should cause the channel to close on the next poll, but in fact the channel won’t close until the user of the bindings drops their request stream, responders, and control handles.
pub fn shutdown_with_epitaph(&self, status: Status)
pub fn shutdown_with_epitaph(&self, status: Status)
Sets the server to shutdown with an epitaph the next time the stream is polled.
TODO(https://fxbug.dev/42153903): This should cause the channel to close on the next poll, but in fact the channel won’t close until the user of the bindings drops their request stream, responders, and control handles.
pub fn check_shutdown(&self, cx: &Context<'_>) -> bool
pub fn check_shutdown(&self, cx: &Context<'_>) -> bool
Checks if the server has been set to shutdown.
pub fn send<T>(
&self,
body: impl Encode<T, D>,
tx_id: u32,
ordinal: u64,
dynamic_flags: DynamicFlags,
) -> Result<(), Error>where
T: TypeMarker,
pub fn send<T>(
&self,
body: impl Encode<T, D>,
tx_id: u32,
ordinal: u64,
dynamic_flags: DynamicFlags,
) -> Result<(), Error>where
T: TypeMarker,
Sends an encodable message to the client.
pub fn send_framework_err(
&self,
framework_err: FrameworkErr,
tx_id: u32,
ordinal: u64,
dynamic_flags: DynamicFlags,
tls_decode_buf: (&mut Vec<u8>, &mut Vec<<<D as ResourceDialect>::Handle as HandleFor<D>>::HandleInfo>),
) -> Result<(), Error>
pub fn send_framework_err( &self, framework_err: FrameworkErr, tx_id: u32, ordinal: u64, dynamic_flags: DynamicFlags, tls_decode_buf: (&mut Vec<u8>, &mut Vec<<<D as ResourceDialect>::Handle as HandleFor<D>>::HandleInfo>), ) -> Result<(), Error>
Sends a framework error to the client.
The caller must be inside a with_tls_decode_buf
callback, and pass the
buffers used to decode the request as the tls_decode_buf
parameter.