Struct tentacle::service::ProtocolMeta
source · pub struct ProtocolMeta { /* private fields */ }Expand description
Define the minimum data required for a custom protocol
Implementations§
source§impl ProtocolMeta
impl ProtocolMeta
sourcepub fn id(&self) -> ProtocolId
pub fn id(&self) -> ProtocolId
Protocol id
sourcepub fn support_versions(&self) -> Vec<String>
pub fn support_versions(&self) -> Vec<String>
Protocol supported version
sourcepub fn codec(&self) -> Box<dyn Codec + Send + 'static>
pub fn codec(&self) -> Box<dyn Codec + Send + 'static>
The codec used by the custom protocol, such as LengthDelimitedCodec by tokio
sourcepub fn service_handle(
&mut self,
) -> ProtocolHandle<Box<dyn ServiceProtocol + Send + Unpin + 'static>>
pub fn service_handle( &mut self, ) -> ProtocolHandle<Box<dyn ServiceProtocol + Send + Unpin + 'static>>
sourcepub fn session_handle(
&mut self,
) -> ProtocolHandle<Box<dyn SessionProtocol + Send + Unpin + 'static>>
pub fn session_handle( &mut self, ) -> ProtocolHandle<Box<dyn SessionProtocol + Send + Unpin + 'static>>
A session level callback handle for a protocol.
§Behavior
When a session is opened, whenever the protocol of the session is opened, the function will be called again to generate the corresponding exclusive handle.
Correspondingly, whenever the protocol is closed, the corresponding exclusive handle is cleared.
Auto Trait Implementations§
impl Freeze for ProtocolMeta
impl !RefUnwindSafe for ProtocolMeta
impl Send for ProtocolMeta
impl !Sync for ProtocolMeta
impl Unpin for ProtocolMeta
impl !UnwindSafe for ProtocolMeta
Blanket Implementations§
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