Struct oasis_core_runtime::enclave_rpc::demux::Demux
source · pub struct Demux { /* private fields */ }
Expand description
Session demultiplexer.
Implementations§
source§impl Demux
impl Demux
sourcepub fn new(
builder: Builder,
max_sessions: usize,
max_sessions_per_peer: usize,
stale_session_timeout: i64,
) -> Self
pub fn new( builder: Builder, max_sessions: usize, max_sessions_per_peer: usize, stale_session_timeout: i64, ) -> Self
Create new session demultiplexer.
sourcepub fn set_session_builder(&self, builder: Builder)
pub fn set_session_builder(&self, builder: Builder)
Set the session builder to use.
sourcepub async fn process_frame<W: Write>(
&self,
peer_id: Vec<u8>,
data: Vec<u8>,
writer: W,
) -> Result<(OwnedMutexGuard<MultiplexedSession<Vec<u8>>>, Option<Message>), Error>
pub async fn process_frame<W: Write>( &self, peer_id: Vec<u8>, data: Vec<u8>, writer: W, ) -> Result<(OwnedMutexGuard<MultiplexedSession<Vec<u8>>>, Option<Message>), Error>
Process a frame, returning the locked session guard and decoded message.
Any data that needs to be transmitted back to the peer is written to the passed writer.
Auto Trait Implementations§
impl !Freeze for Demux
impl RefUnwindSafe for Demux
impl Send for Demux
impl Sync for Demux
impl Unpin for Demux
impl UnwindSafe for Demux
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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