pub struct Eds {
pub vendor_name: Option<String>,
pub product_name: Option<String>,
pub node_id: Option<u8>,
pub objects: Vec<ObjectDescription>,
}Expand description
A parsed Electronic Data Sheet (or Device Configuration File).
Fields§
§vendor_name: Option<String>[DeviceInfo] VendorName, if present.
product_name: Option<String>[DeviceInfo] ProductName, if present.
node_id: Option<u8>[DeviceComissioning] NodeID, if present — also used to resolve
$NODEID expressions in default values.
objects: Vec<ObjectDescription>The described objects, ordered by address.
Implementations§
Source§impl Eds
impl Eds
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Eds, EdsError>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Eds, EdsError>
Read and parse an EDS/DCF file from path.
Sourcepub fn get(&self, address: Address) -> Option<&ObjectDescription>
pub fn get(&self, address: Address) -> Option<&ObjectDescription>
The described object at address, if any.
Sourcepub fn object_dictionary<const N: usize>(
&self,
) -> Result<ObjectDictionary<N>, EdsError>
pub fn object_dictionary<const N: usize>( &self, ) -> Result<ObjectDictionary<N>, EdsError>
Build a core ObjectDictionary of capacity N from the described
objects.
Returns EdsError::TooManyObjects if there are more objects than N.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Eds
impl RefUnwindSafe for Eds
impl Send for Eds
impl Sync for Eds
impl Unpin for Eds
impl UnsafeUnpin for Eds
impl UnwindSafe for Eds
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more