pub trait MessageWrite {
type Output;
// Required methods
fn mut_data(&mut self) -> &mut [u8] ⓘ;
fn data(&self) -> &[u8] ⓘ;
fn len(&self) -> usize;
fn push_data(&mut self, data: &[u8]);
fn push_attribute_unchecked(&mut self, attr: &dyn AttributeWrite);
fn has_attribute(&self, atype: AttributeType) -> bool;
fn has_any_attribute(
&self,
atypes: &[AttributeType],
) -> Option<AttributeType>;
fn finish(self) -> Self::Output;
// Provided method
fn max_size(&self) -> Option<usize> { ... }
}Expand description
Trait for implementing a writer for Messages.
Required Associated Types§
Sourcetype Output
type Output
The output of this MessageWrite.
Required Methods§
Sourcefn push_attribute_unchecked(&mut self, attr: &dyn AttributeWrite)
fn push_attribute_unchecked(&mut self, attr: &dyn AttributeWrite)
Write an attribute to the end of the Message.
Sourcefn has_attribute(&self, atype: AttributeType) -> bool
fn has_attribute(&self, atype: AttributeType) -> bool
Return whether this MessageWrite contains a particular attribute.
Sourcefn has_any_attribute(&self, atypes: &[AttributeType]) -> Option<AttributeType>
fn has_any_attribute(&self, atypes: &[AttributeType]) -> Option<AttributeType>
Return whether this MessageWrite contains any of the provided attributes and
returns the attribute found.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".