pub struct XmlAlarmMessage { /* private fields */ }Expand description
Bounded XML alarm with exact inbound wire-payload preservation.
Self::from_xml constructs the canonical zero-padded outbound form;
Self::from_wire_payload retains any accepted framed form byte-for-byte.
Implementations§
Source§impl XmlAlarmMessage
impl XmlAlarmMessage
Sourcepub fn from_xml(xml: impl AsRef<[u8]>) -> Result<Self, CodecError>
pub fn from_xml(xml: impl AsRef<[u8]>) -> Result<Self, CodecError>
Builds the canonical outbound alarm payload from a NUL-free XML document.
Sourcepub fn from_wire_payload(
payload: impl Into<Box<[u8]>>,
) -> Result<Self, CodecError>
pub fn from_wire_payload( payload: impl Into<Box<[u8]>>, ) -> Result<Self, CodecError>
Retains an inbound alarm payload without requiring a canonical length.
Sourcepub fn xml_bytes(&self) -> &[u8] ⓘ
pub fn xml_bytes(&self) -> &[u8] ⓘ
Returns the XML bytes through the first NUL, or the full payload if none exists.
Sourcepub fn wire_payload(&self) -> &[u8] ⓘ
pub fn wire_payload(&self) -> &[u8] ⓘ
Returns the complete retained payload, including terminator and padding bytes.
Trait Implementations§
Source§impl Clone for XmlAlarmMessage
impl Clone for XmlAlarmMessage
Source§fn clone(&self) -> XmlAlarmMessage
fn clone(&self) -> XmlAlarmMessage
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 XmlAlarmMessage
impl Debug for XmlAlarmMessage
impl Eq for XmlAlarmMessage
Source§impl PartialEq for XmlAlarmMessage
impl PartialEq for XmlAlarmMessage
impl StructuralPartialEq for XmlAlarmMessage
Auto Trait Implementations§
impl Freeze for XmlAlarmMessage
impl RefUnwindSafe for XmlAlarmMessage
impl Send for XmlAlarmMessage
impl Sync for XmlAlarmMessage
impl Unpin for XmlAlarmMessage
impl UnsafeUnpin for XmlAlarmMessage
impl UnwindSafe for XmlAlarmMessage
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