pub struct DataMessage {
pub label: String,
pub content_type: String,
pub bytes: Bytes,
pub reliability: DataReliability,
pub message_id: MessageId,
}Expand description
A data-plane message that can be mapped to a WebRTC DataChannel, UCTP
message.send, SIP MESSAGE, or an application-owned metadata transport.
Fields§
§label: String§content_type: String§bytes: Bytes§reliability: DataReliability§message_id: MessageIdImplementations§
Source§impl DataMessage
impl DataMessage
pub fn reliable( label: impl Into<String>, content_type: impl Into<String>, bytes: impl Into<Bytes>, ) -> Self
pub fn try_new( label: impl Into<String>, content_type: impl Into<String>, bytes: impl Into<Bytes>, reliability: DataReliability, message_id: MessageId, ) -> Result<Self, DataMessageValidationError>
pub fn validate(&self) -> Result<(), DataMessageValidationError>
Trait Implementations§
Source§impl Clone for DataMessage
impl Clone for DataMessage
Source§fn clone(&self) -> DataMessage
fn clone(&self) -> DataMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataMessage
impl Debug for DataMessage
Source§impl<'de> Deserialize<'de> for DataMessage
impl<'de> Deserialize<'de> for DataMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DataMessage
Source§impl PartialEq for DataMessage
impl PartialEq for DataMessage
Source§impl Serialize for DataMessage
impl Serialize for DataMessage
impl StructuralPartialEq for DataMessage
Auto Trait Implementations§
impl !Freeze for DataMessage
impl RefUnwindSafe for DataMessage
impl Send for DataMessage
impl Sync for DataMessage
impl Unpin for DataMessage
impl UnsafeUnpin for DataMessage
impl UnwindSafe for DataMessage
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