pub struct Frame {
pub protocol_version: u32,
pub message_id: u32,
pub payload: Vec<u8>,
}Expand description
One complete SCCP frame with an uninterpreted payload.
FrameDecoder produces frames from a byte stream. Call the appropriate
typed message decoder afterward to validate the payload contract.
Fields§
§protocol_version: u32§message_id: u32§payload: Vec<u8>Implementations§
Source§impl Frame
impl Frame
Sourcepub fn new(protocol_version: u32, message_id: u32, payload: Vec<u8>) -> Self
pub fn new(protocol_version: u32, message_id: u32, payload: Vec<u8>) -> Self
Creates a frame without validating its payload or total encoded size.
Size validation occurs in Frame::encode or in typed message codecs.
Sourcepub fn encode(&self) -> Result<Vec<u8>, CodecError>
pub fn encode(&self) -> Result<Vec<u8>, CodecError>
SCCP length includes the four-byte message ID, but excludes the first two header words.
Sourcepub fn message_type(&self) -> MessageId
pub fn message_type(&self) -> MessageId
Resolves the numeric identifier to its typed catalog value.
Unrecognized identifiers become MessageId::Unknown.
Trait Implementations§
impl Eq for Frame
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
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