pub struct ServeInner<D: ResourceDialect = DefaultFuchsiaResourceDialect> { /* private fields */ }
Expand description
A type used from the innards of server implementations.
Implementations§
Source§impl<D: ResourceDialect> ServeInner<D>
impl<D: ResourceDialect> ServeInner<D>
Sourcepub fn new(channel: D::ProxyChannel) -> Self
pub fn new(channel: D::ProxyChannel) -> Self
Creates a new set of server innards.
Sourcepub fn channel(&self) -> &<D::ProxyChannel as ProxyChannelFor<D>>::Boxed
pub fn channel(&self) -> &<D::ProxyChannel as ProxyChannelFor<D>>::Boxed
Gets a reference to the inner channel.
Sourcepub fn into_channel(self) -> D::ProxyChannel
pub fn into_channel(self) -> D::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.
Sourcepub 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.
Sourcepub 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.
Sourcepub fn check_shutdown(&self, cx: &Context<'_>) -> bool
pub fn check_shutdown(&self, cx: &Context<'_>) -> bool
Checks if the server has been set to shutdown.
Sourcepub fn send<T: TypeMarker>(
&self,
body: impl Encode<T, D>,
tx_id: u32,
ordinal: u64,
dynamic_flags: DynamicFlags,
) -> Result<(), Error>
pub fn send<T: TypeMarker>( &self, body: impl Encode<T, D>, tx_id: u32, ordinal: u64, dynamic_flags: DynamicFlags, ) -> Result<(), Error>
Sends an encodable message to the client.
Sourcepub 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::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::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.