pub struct DomainFrame { /* private fields */ }Expand description
Individual frame in a priority stream
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn skeleton(
stream_id: StreamId,
sequence: u64,
skeleton_data: JsonData,
) -> Frame
pub fn skeleton( stream_id: StreamId, sequence: u64, skeleton_data: JsonData, ) -> Frame
Create new skeleton frame
Sourcepub fn patch(
stream_id: StreamId,
sequence: u64,
priority: Priority,
patches: Vec<FramePatch>,
) -> Result<Frame, DomainError>
pub fn patch( stream_id: StreamId, sequence: u64, priority: Priority, patches: Vec<FramePatch>, ) -> Result<Frame, DomainError>
Create new patch frame
Sourcepub fn complete(
stream_id: StreamId,
sequence: u64,
checksum: Option<String>,
) -> Frame
pub fn complete( stream_id: StreamId, sequence: u64, checksum: Option<String>, ) -> Frame
Create completion frame
Sourcepub fn error(
stream_id: StreamId,
sequence: u64,
error_message: String,
error_code: Option<String>,
) -> Frame
pub fn error( stream_id: StreamId, sequence: u64, error_message: String, error_code: Option<String>, ) -> Frame
Create error frame
Sourcepub fn frame_type(&self) -> &FrameType
pub fn frame_type(&self) -> &FrameType
Get frame type
Sourcepub fn with_metadata(self, key: String, value: String) -> Frame
pub fn with_metadata(self, key: String, value: String) -> Frame
Add metadata
Sourcepub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata(&self, key: &str) -> Option<&String>
Get metadata value
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Check if frame is critical priority
Sourcepub fn is_high_priority(&self) -> bool
pub fn is_high_priority(&self) -> bool
Check if frame is high priority or above
Sourcepub fn estimated_size(&self) -> usize
pub fn estimated_size(&self) -> usize
Estimate frame size in bytes (for network planning)
Sourcepub fn validate(&self) -> Result<(), DomainError>
pub fn validate(&self) -> Result<(), DomainError>
Validate frame consistency
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Frame
impl<'de> Deserialize<'de> for Frame
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Frame
impl Serialize for Frame
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more