Skip to main content

Body

Enum Body 

Source
#[non_exhaustive]
pub enum Body<'a> {
Show 15 variants OpenRequest(OpenRequest<'a>), OpenResponse(OpenResponse<'a>), CloseRequest(CloseRequest<'a>), CloseResponse(CloseResponse<'a>), GetListRequest(GetListRequest<'a>), GetListResponse(GetListResponse<'a>), Attention(Attention<'a>), GetProcParameterRequest(GetProcParameterRequest<'a>), GetProcParameterResponse(GetProcParameterResponse<'a>), SetProcParameterRequest(SetProcParameterRequest<'a>), GetProfilePackRequest(GetProfileRequest<'a>), GetProfileListRequest(GetProfileRequest<'a>), GetProfileListResponse(GetProfileListResponse<'a>), GetProfilePackResponse(GetProfilePackResponse<'a>), Other { tag: u32, raw: &'a [u8], },
}
Expand description

A message body.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

OpenRequest(OpenRequest<'a>)

A client opens an SML file.

§

OpenResponse(OpenResponse<'a>)

The device opens an SML file.

§

CloseRequest(CloseRequest<'a>)

A client closes an SML file.

§

CloseResponse(CloseResponse<'a>)

The device closes an SML file.

§

GetListRequest(GetListRequest<'a>)

A client asks for a list of values.

§

GetListResponse(GetListResponse<'a>)

Readings: a list of named values.

§

Attention(Attention<'a>)

An error or status code from the device. Also the answer to a set request.

§

GetProcParameterRequest(GetProcParameterRequest<'a>)

A client asks for parameters.

§

GetProcParameterResponse(GetProcParameterResponse<'a>)

Parameters: a tree of named values.

§

SetProcParameterRequest(SetProcParameterRequest<'a>)

A client sets parameters. The device answers with an Attention.

§

GetProfilePackRequest(GetProfileRequest<'a>)

A client asks for a profile as one packed response (SML_GetProfilePack.Req).

§

GetProfileListRequest(GetProfileRequest<'a>)

A client asks for a profile as a list of periods (SML_GetProfileList.Req).

§

GetProfileListResponse(GetProfileListResponse<'a>)

One period of a profile, e.g. one logbook entry.

§

GetProfilePackResponse(GetProfilePackResponse<'a>)

A whole profile: column headers once, then rows of values.

§

Other

A body this crate does not type, with its raw bytes: the COSEM bodies, for which no real use was found.

Fields

§tag: u32

The body’s tag.

§raw: &'a [u8]

The body’s encoded value, TL bytes included.

Implementations§

Source§

impl<'a> Body<'a>

Source

pub const fn tag(&self) -> u32

The body’s tag.

Source

pub fn write(&self, w: &mut Writer<'_>) -> Result<()>

Write the body (List(2) { tag, body }).

Trait Implementations§

Source§

impl<'a> Clone for Body<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Body<'a>

Source§

impl<'a> Debug for Body<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for Body<'a>

Source§

impl<'a> PartialEq for Body<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Body<'a>

Auto Trait Implementations§

§

impl<'a> Forget for Body<'a>

§

impl<'a> Freeze for Body<'a>
where &'a [u8]: Freeze, &'a [ListEntry<'a>]: Freeze, &'a [&'a [u8]]: Freeze, &'a [Tree<'a>]: Freeze, &'a [PeriodEntry<'a>]: Freeze, &'a [ProfileColumn]: Freeze, &'a [ProfilePeriod<'a>]: Freeze,

§

impl<'a> Move for Body<'a>

§

impl<'a> RefUnwindSafe for Body<'a>

§

impl<'a> Send for Body<'a>
where &'a [u8]: Send, &'a [ListEntry<'a>]: Send, &'a [&'a [u8]]: Send, &'a [Tree<'a>]: Send, &'a [PeriodEntry<'a>]: Send, &'a [ProfileColumn]: Send, &'a [ProfilePeriod<'a>]: Send,

§

impl<'a> Sync for Body<'a>

§

impl<'a> Unpin for Body<'a>
where &'a [u8]: Unpin, &'a [ListEntry<'a>]: Unpin, &'a [&'a [u8]]: Unpin, &'a [Tree<'a>]: Unpin, &'a [PeriodEntry<'a>]: Unpin, &'a [ProfileColumn]: Unpin, &'a [ProfilePeriod<'a>]: Unpin,

§

impl<'a> UnsafeUnpin for Body<'a>
where &'a [u8]: UnsafeUnpin, &'a [ListEntry<'a>]: UnsafeUnpin, &'a [&'a [u8]]: UnsafeUnpin, &'a [Tree<'a>]: UnsafeUnpin, &'a [PeriodEntry<'a>]: UnsafeUnpin, &'a [ProfileColumn]: UnsafeUnpin, &'a [ProfilePeriod<'a>]: UnsafeUnpin,

§

impl<'a> UnwindSafe for Body<'a>
where &'a [u8]: UnwindSafe, &'a [ListEntry<'a>]: UnwindSafe, &'a [&'a [u8]]: UnwindSafe, &'a [Tree<'a>]: UnwindSafe, &'a [PeriodEntry<'a>]: UnwindSafe, &'a [ProfileColumn]: UnwindSafe, &'a [ProfilePeriod<'a>]: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.