pub struct StompParser {
pub message: StompMessage,
/* private fields */
}Expand description
A push parser, externally a buffer is being filled with the STOMP message and headers as it arrive we process the data as it comes off the stream and save state between chunks of data arriving.
Fields§
§message: StompMessageImplementations§
Source§impl StompParser
impl StompParser
pub fn new(session_id: usize) -> StompParser
Sourcepub fn take_message(&mut self, owner: Ownership) -> StompMessage
pub fn take_message(&mut self, owner: Ownership) -> StompMessage
take ownership of the parsed message
pub fn bytes_read(&self) -> usize
Sourcepub fn push(
&mut self,
buffer: &[u8],
pos: usize,
chunk: &[u8],
) -> Result<ParserState, ParserState>
pub fn push( &mut self, buffer: &[u8], pos: usize, chunk: &[u8], ) -> Result<ParserState, ParserState>
Required a complete rewrite from xtomp because rust does not have for loops or p++ and can not index arrays easily
buffer the full buffer we are loading
pos position in the outer buffer (not the chunk)
chunk slice of input buffer we are reading
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StompParser
impl RefUnwindSafe for StompParser
impl Send for StompParser
impl Sync for StompParser
impl Unpin for StompParser
impl UnsafeUnpin for StompParser
impl UnwindSafe for StompParser
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