[−][src]Struct cjdns_ctrl::ErrorData
Body data for error type messages
additional
field states for raw data, that is allowed not to be parsed.
Fields
err_type: ErrorMessageType
switch_header: SwitchHeader
additional: Vec<u8>
Implementations
impl ErrorData
[src]
pub const MIN_SIZE: usize
[src]
ErrorData
minimum size. First 4 bytes are reserved for error type code.
pub fn parse(bytes: &[u8]) -> Result<Self, ParseError>
[src]
Parses raw bytes into ErrorData
Result in error in several situations:
- input bytes length is less than
ErrorData::MIN_SIZE
- switch header parsing failed
- received error type has zero code, which is considered as
None
error.
pub fn serialize(&self) -> Result<Vec<u8>, SerializeError>
[src]
Serializes ErrorData
instance.
ErrorData
type can be instantiated directly, without using parse
method.
That's why serialization can result in errors in several situations:
- instance error type has a
Unrecognized
orNone
type - switch header serialization failed
Trait Implementations
impl Clone for ErrorData
[src]
impl Debug for ErrorData
[src]
impl Eq for ErrorData
[src]
impl PartialEq<ErrorData> for ErrorData
[src]
impl StructuralEq for ErrorData
[src]
impl StructuralPartialEq for ErrorData
[src]
Auto Trait Implementations
impl RefUnwindSafe for ErrorData
impl Send for ErrorData
impl Sync for ErrorData
impl Unpin for ErrorData
impl UnwindSafe for ErrorData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,