pub struct PrefixDetector { /* private fields */ }Expand description
A simple prefix-based detector useful for testing and simple protocols.
Implementations§
Source§impl PrefixDetector
impl PrefixDetector
pub fn new(id: ProtocolId, prefix: Vec<u8>) -> Self
pub fn with_min_length( id: ProtocolId, prefix: Vec<u8>, min_length: usize, ) -> Self
Trait Implementations§
Source§impl ProtocolDetector for PrefixDetector
impl ProtocolDetector for PrefixDetector
Source§fn id(&self) -> ProtocolId
fn id(&self) -> ProtocolId
Returns the unique identifier for the protocol this detector handles.
Auto Trait Implementations§
impl Freeze for PrefixDetector
impl RefUnwindSafe for PrefixDetector
impl Send for PrefixDetector
impl Sync for PrefixDetector
impl Unpin for PrefixDetector
impl UnsafeUnpin for PrefixDetector
impl UnwindSafe for PrefixDetector
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