zer0-proto-mp · frame
Source declarations, signatures and documentation for frame.
Source: sigil/weave/libs/zer0-proto-mp/src/frame.rs. SHA-256: bb6751071c6adc791ddb94d66cf5c667254bf242d220da69aa164811274ff495.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
frame::ChannelId
Channel ID type
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub struct ChannelId(pub u32);Source line: 9.
frame::ChannelId::CONTROL
pub const CONTROL: Self;Source line: 12.
frame::MessageType
Message types in the protocol
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MessageType {
Open = 0,
Close = 1,
Data = 2,
Handshake = 3,
Capabilities = 4,
KeepAlive = 5,
Credits = 6,
Abort = 7,
HalfClose = 8,
}Source line: 18.
frame::Frame
Wire protocol frame
#[derive(Debug, Clone)]
pub struct Frame {
pub channel: ChannelId,
pub message_type: MessageType,
pub payload: Bytes
}Source line: 51.
frame::Frame::new
Create a new frame
pub fn new(channel: ChannelId, message_type: MessageType, payload: Bytes) -> Self;Source line: 59.
frame::Frame::data
Create a data frame
pub fn data(channel: ChannelId, payload: Bytes) -> Self;Source line: 68.
frame::Frame::close
Create a close frame
pub fn close(channel: ChannelId) -> Self;Source line: 73.
frame::Frame::encode
Encode frame to bytes
pub fn encode(&self) -> Bytes;Source line: 78.
frame::Frame::decode
Decode frame from bytes Returns None if more data is needed
pub fn decode(buf: &mut BytesMut) -> Result<Option<Self>>;Source line: 101.
frame::Frame::encoded_size
Get the encoded size of this frame
pub fn encoded_size(&self) -> usize;Source line: 141.