pub enum Frame {
PayloadFrame(PayloadFrame),
Cancel(Cancel),
ErrorFrame(ErrorFrame),
RequestN(RequestN),
RequestResponse(RequestResponse),
RequestFnF(RequestFnF),
RequestStream(RequestStream),
RequestChannel(RequestChannel),
}
Expand description
An enum that can hold any time of wasmrs frame.
Variants§
PayloadFrame(PayloadFrame)
Cancel(Cancel)
ErrorFrame(ErrorFrame)
RequestN(RequestN)
RequestResponse(RequestResponse)
RequestFnF(RequestFnF)
RequestStream(RequestStream)
RequestChannel(RequestChannel)
Implementations§
Source§impl Frame
impl Frame
Sourcepub const FLAG_IGNORE: u16 = 16u16
pub const FLAG_IGNORE: u16 = 16u16
The IGNORE bit
Sourcepub const FLAG_COMPLETE: u16 = 64u16
pub const FLAG_COMPLETE: u16 = 64u16
The COMPLETE bit
Sourcepub const FLAG_FOLLOW: u16 = 128u16
pub const FLAG_FOLLOW: u16 = 128u16
The FOLLOW bit
Sourcepub const FLAG_METADATA: u16 = 256u16
pub const FLAG_METADATA: u16 = 256u16
The METADATA bit
Sourcepub const REQUEST_MAX: u32 = 2_147_483_647u32
pub const REQUEST_MAX: u32 = 2_147_483_647u32
The maximum number of N for RequestN
Sourcepub fn frame_type(&self) -> FrameType
pub fn frame_type(&self) -> FrameType
Get the FrameType.
Sourcepub fn make_v0_metadata(&mut self)
pub fn make_v0_metadata(&mut self)
Convert the metadata to v0 metadata.
Sourcepub fn new_error(stream_id: u32, e: PayloadError) -> Frame
pub fn new_error(stream_id: u32, e: PayloadError) -> Frame
Create a new [ErrorFrame].
Sourcepub fn new_cancel(stream_id: u32) -> Frame
pub fn new_cancel(stream_id: u32) -> Frame
Create a new [Cancel] frame.
Sourcepub fn new_request_n(stream_id: u32, n: u32, _flags: u16) -> Frame
pub fn new_request_n(stream_id: u32, n: u32, _flags: u16) -> Frame
Create a new [RequestN] frame.
Sourcepub fn new_request_response(
stream_id: u32,
payload: RawPayload,
flags: u16,
) -> Frame
pub fn new_request_response( stream_id: u32, payload: RawPayload, flags: u16, ) -> Frame
Create a new [RequestResponse] frame.
Sourcepub fn new_request_stream(
stream_id: u32,
payload: RawPayload,
flags: u16,
) -> Frame
pub fn new_request_stream( stream_id: u32, payload: RawPayload, flags: u16, ) -> Frame
Create a new [RequestStream] frame.
Sourcepub fn new_request_channel(
stream_id: u32,
payload: RawPayload,
flags: u16,
initial_n: u32,
) -> Frame
pub fn new_request_channel( stream_id: u32, payload: RawPayload, flags: u16, initial_n: u32, ) -> Frame
Create a new [RequestChannel] frame.
Sourcepub fn new_request_fnf(stream_id: u32, payload: RawPayload, flags: u16) -> Frame
pub fn new_request_fnf(stream_id: u32, payload: RawPayload, flags: u16) -> Frame
Create a new [RequestFnF] (Fire & Forget) frame
Sourcepub fn new_payload(stream_id: u32, payload: RawPayload, flags: u16) -> Frame
pub fn new_payload(stream_id: u32, payload: RawPayload, flags: u16) -> Frame
Create a new [PayloadFrame].
Trait Implementations§
Source§impl From<Frame> for Result<Option<RawPayload>, PayloadError>
impl From<Frame> for Result<Option<RawPayload>, PayloadError>
Source§fn from(frame: Frame) -> Result<Option<RawPayload>, PayloadError>
fn from(frame: Frame) -> Result<Option<RawPayload>, PayloadError>
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin 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