Skip to main content

CosemDataType

Enum CosemDataType 

Source
pub enum CosemDataType {
Show 14 variants Null, Array(Vec<CosemDataType>), Structure(Vec<CosemDataType>), Boolean(bool), Integer(i8), Long(i16), Unsigned(u8), LongUnsigned(u16), DoubleLong(i32), DoubleLongUnsigned(u32), OctetString(Vec<u8>), DateTime(Vec<u8>), BitString(Vec<u8>), Enum(u8),
}
Expand description

A COSEM common data type (IEC 62056-6-2, Table 3), with A-XDR (BER) serialization via CosemDataType::serialize_ber / CosemDataType::deserialize_ber.

Variants§

§

Null

null-data (tag 0).

§

Array(Vec<CosemDataType>)

array (tag 1) — a sequence of same-typed elements.

§

Structure(Vec<CosemDataType>)

structure (tag 2) — a sequence of (possibly differently typed) elements.

§

Boolean(bool)

boolean (tag 3).

§

Integer(i8)

integer — signed 8-bit (tag 15).

§

Long(i16)

long — signed 16-bit (tag 16).

§

Unsigned(u8)

unsigned — unsigned 8-bit (tag 17).

§

LongUnsigned(u16)

long-unsigned — unsigned 16-bit (tag 18).

§

DoubleLong(i32)

double-long — signed 32-bit (tag 5).

§

DoubleLongUnsigned(u32)

double-long-unsigned — unsigned 32-bit (tag 6).

§

OctetString(Vec<u8>)

octet-string (tag 9).

§

DateTime(Vec<u8>)

date-time (tag 25) — a 12-octet date-time value.

§

BitString(Vec<u8>)

bit-string (tag 4) — held as raw octets.

§

Enum(u8)

enum — an enumerated 8-bit value (tag 22).

Implementations§

Source§

impl CosemDataType

Source

pub fn serialize_ber(&self, buf: &mut Vec<u8>) -> Result<(), BerError>

Appends the A-XDR (BER) encoding of this value to buf.

Source

pub fn deserialize_ber(data: &[u8]) -> Result<(Self, &[u8]), BerError>

Decodes one A-XDR (BER) value from data, returning it and the unconsumed remainder.

Trait Implementations§

Source§

impl Clone for CosemDataType

Source§

fn clone(&self) -> CosemDataType

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 Debug for CosemDataType

Source§

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

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

impl<'de> Deserialize<'de> for CosemDataType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for CosemDataType

Source§

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

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

impl From<AccessRight> for CosemDataType

Source§

fn from(ar: AccessRight) -> Self

Converts to this type from the input type.
Source§

impl From<ActionItem> for CosemDataType

Source§

fn from(ai: ActionItem) -> Self

Converts to this type from the input type.
Source§

impl From<ActionSet> for CosemDataType

Source§

fn from(a: ActionSet) -> Self

Converts to this type from the input type.
Source§

impl From<ActionSpecification> for CosemDataType

Source§

fn from(aspec: ActionSpecification) -> Self

Converts to this type from the input type.
Source§

impl From<AssociatedPartnersId> for CosemDataType

Source§

fn from(ap: AssociatedPartnersId) -> Self

Converts to this type from the input type.
Source§

impl From<AttributeAccessItem> for CosemDataType

Source§

fn from(item: AttributeAccessItem) -> Self

Converts to this type from the input type.
Source§

impl From<BitString> for CosemDataType

Source§

fn from(bs: BitString) -> Self

Converts to this type from the input type.
Source§

impl From<CaptureObjectDefinition> for CosemDataType

Source§

fn from(cod: CaptureObjectDefinition) -> Self

Converts to this type from the input type.
Source§

impl From<CellInfo> for CosemDataType

Source§

fn from(ci: CellInfo) -> Self

Converts to this type from the input type.
Source§

impl From<Certificate> for CosemDataType

Source§

fn from(c: Certificate) -> Self

Converts to this type from the input type.
Source§

impl From<CommunicationWindow> for CosemDataType

Source§

fn from(cw: CommunicationWindow) -> Self

Converts to this type from the input type.
Source§

impl From<ConfirmationParameters> for CosemDataType

Source§

fn from(cp: ConfirmationParameters) -> Self

Converts to this type from the input type.
Source§

impl From<ContextName> for CosemDataType

Source§

fn from(cn: ContextName) -> Self

Converts to this type from the input type.
Source§

impl From<DateTime> for CosemDataType

Source§

fn from(dt: DateTime) -> Self

Converts to this type from the input type.
Source§

impl From<DayProfile> for CosemDataType

Source§

fn from(dp: DayProfile) -> Self

Converts to this type from the input type.
Source§

impl From<DayProfileAction> for CosemDataType

Source§

fn from(a: DayProfileAction) -> Self

Converts to this type from the input type.
Source§

impl From<EmergencyProfile> for CosemDataType

Source§

fn from(ep: EmergencyProfile) -> Self

Converts to this type from the input type.
Source§

impl From<ExecutedScript> for CosemDataType

Source§

fn from(es: ExecutedScript) -> Self

Converts to this type from the input type.
Source§

impl From<ExecutionTime> for CosemDataType

Source§

fn from(et: ExecutionTime) -> Self

Converts to this type from the input type.
Source§

impl From<GsmAdjacentCell> for CosemDataType

Source§

fn from(cell: GsmAdjacentCell) -> Self

Converts to this type from the input type.
Source§

impl From<GsmServiceParameter> for CosemDataType

Source§

fn from(p: GsmServiceParameter) -> Self

Converts to this type from the input type.
Source§

impl From<ImageToActivateInfo> for CosemDataType

Source§

fn from(info: ImageToActivateInfo) -> Self

Converts to this type from the input type.
Source§

impl From<IpOption> for CosemDataType

Source§

fn from(opt: IpOption) -> Self

Converts to this type from the input type.
Source§

impl From<LimiterAction> for CosemDataType

Source§

fn from(a: LimiterAction) -> Self

Converts to this type from the input type.
Source§

impl From<MethodAccessItem> for CosemDataType

Source§

fn from(item: MethodAccessItem) -> Self

Converts to this type from the input type.
Source§

impl From<NeighborDiscoverySetup> for CosemDataType

Source§

fn from(nd: NeighborDiscoverySetup) -> Self

Converts to this type from the input type.
Source§

impl From<ObjectDefinition> for CosemDataType

Source§

fn from(od: ObjectDefinition) -> Self

Converts to this type from the input type.
Source§

impl From<ObjectListElement> for CosemDataType

Source§

fn from(e: ObjectListElement) -> Self

Converts to this type from the input type.
Source§

impl From<ProtectionObject> for CosemDataType

Source§

fn from(po: ProtectionObject) -> Self

Converts to this type from the input type.
Source§

impl From<PushProtectionParameter> for CosemDataType

Source§

fn from(pp: PushProtectionParameter) -> Self

Converts to this type from the input type.
Source§

impl From<QualityOfService> for CosemDataType

Source§

fn from(qos: QualityOfService) -> Self

Converts to this type from the input type.
Source§

impl From<RegisterActMask> for CosemDataType

Source§

fn from(m: RegisterActMask) -> Self

Converts to this type from the input type.
Source§

impl From<SapAssignmentEntry> for CosemDataType

Source§

fn from(entry: SapAssignmentEntry) -> Self

Converts to this type from the input type.
Source§

impl From<ScalerUnit> for CosemDataType

Source§

fn from(su: ScalerUnit) -> Self

Converts to this type from the input type.
Source§

impl From<ScheduleTableEntry> for CosemDataType

Source§

fn from(e: ScheduleTableEntry) -> Self

Converts to this type from the input type.
Source§

impl From<Script> for CosemDataType

Source§

fn from(s: Script) -> Self

Converts to this type from the input type.
Source§

impl From<SeasonProfile> for CosemDataType

Source§

fn from(sp: SeasonProfile) -> Self

Converts to this type from the input type.
Source§

impl From<SendDestinationAndMethod> for CosemDataType

Source§

fn from(s: SendDestinationAndMethod) -> Self

Converts to this type from the input type.
Source§

impl From<SpecialDayEntry> for CosemDataType

Source§

fn from(e: SpecialDayEntry) -> Self

Converts to this type from the input type.
Source§

impl From<StatusMappingEntry> for CosemDataType

Source§

fn from(e: StatusMappingEntry) -> Self

Converts to this type from the input type.
Source§

impl From<User> for CosemDataType

Source§

fn from(u: User) -> Self

Converts to this type from the input type.
Source§

impl From<ValueDefinition> for CosemDataType

Source§

fn from(vd: ValueDefinition) -> Self

Converts to this type from the input type.
Source§

impl From<WeekProfile> for CosemDataType

Source§

fn from(wp: WeekProfile) -> Self

Converts to this type from the input type.
Source§

impl From<XDLMSContextInfo> for CosemDataType

Source§

fn from(ctx: XDLMSContextInfo) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CosemDataType

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for CosemDataType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CosemDataType

Source§

impl TryFrom<&CosemDataType> for DateTime

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ScalerUnit

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for CaptureObjectDefinition

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for AccessRight

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for AttributeAccessItem

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for MethodAccessItem

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ObjectListElement

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for AssociatedPartnersId

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ContextName

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for XDLMSContextInfo

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ValueDefinition

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ActionItem

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ActionSet

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ActionSpecification

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for Script

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ScheduleTableEntry

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for SpecialDayEntry

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for SeasonProfile

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for WeekProfile

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for DayProfileAction

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for DayProfile

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for SendDestinationAndMethod

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for CommunicationWindow

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for EmergencyProfile

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for LimiterAction

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ObjectDefinition

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for RegisterActMask

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ImageToActivateInfo

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ExecutedScript

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for SapAssignmentEntry

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for GsmAdjacentCell

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ProtectionObject

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for IpOption

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for NeighborDiscoverySetup

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for User

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ExecutionTime

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for GsmServiceParameter

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for QualityOfService

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for CellInfo

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for PushProtectionParameter

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for ConfirmationParameters

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for Certificate

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<&CosemDataType> for StatusMappingEntry

Source§

type Error = String

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

fn try_from(value: &CosemDataType) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more