pub struct Interface { /* private fields */ }Expand description
Astarte interface implementation.
Should be used only through its conversion methods, not instantiated directly.
Implementations§
Source§impl Interface
impl Interface
Sourcepub fn inner(&self) -> &InterfaceTypeAggregation
pub fn inner(&self) -> &InterfaceTypeAggregation
Returns the inner enum of the InterfaceTypeAggregation
Sourcepub fn interface_name(&self) -> &str
pub fn interface_name(&self) -> &str
Returns the interface name.
Sourcepub fn version(&self) -> InterfaceVersion
pub fn version(&self) -> InterfaceVersion
Returns the interface version.
Sourcepub fn version_major(&self) -> i32
pub fn version_major(&self) -> i32
Returns the interface major version.
Sourcepub fn version_minor(&self) -> i32
pub fn version_minor(&self) -> i32
Returns the interface minor version.
Sourcepub fn interface_type(&self) -> InterfaceType
pub fn interface_type(&self) -> InterfaceType
Returns the interface type.
Sourcepub fn aggregation(&self) -> Aggregation
pub fn aggregation(&self) -> Aggregation
Returns the interface aggregation.
Sourcepub fn validate_with(&self, prev: &Self) -> Result<&Self, Error>
pub fn validate_with(&self, prev: &Self) -> Result<&Self, Error>
Validate an interface given the previous version prev.
It will check whether:
- Both the versions are valid
- The name of the interface is the same
- The new version is a valid successor of the previous version.
Sourcepub fn as_datastream_individual(&self) -> Option<&DatastreamIndividual>
pub fn as_datastream_individual(&self) -> Option<&DatastreamIndividual>
Return a reference to a DatastreamIndividual.
Sourcepub fn as_datastream_object(&self) -> Option<&DatastreamObject>
pub fn as_datastream_object(&self) -> Option<&DatastreamObject>
Return a reference to a DatastreamObject.
Sourcepub fn as_properties(&self) -> Option<&Properties>
pub fn as_properties(&self) -> Option<&Properties>
Return a reference to a Properties.
Sourcepub fn is_datastream_individual(&self) -> bool
pub fn is_datastream_individual(&self) -> bool
Returns true if the interface type is DatastreamIndividual.
Sourcepub fn is_datastream_object(&self) -> bool
pub fn is_datastream_object(&self) -> bool
Returns true if the interface type is DatastreamObject.
Sourcepub fn is_properties(&self) -> bool
pub fn is_properties(&self) -> bool
Returns true if the interface type is Properties.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Interface
impl<'de> Deserialize<'de> for Interface
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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<T> TryFrom<InterfaceJson<T>> for Interface
impl<T> TryFrom<InterfaceJson<T>> for Interface
impl Eq for Interface
impl StructuralPartialEq for Interface
Auto Trait Implementations§
impl Freeze for Interface
impl RefUnwindSafe for Interface
impl Send for Interface
impl Sync for Interface
impl Unpin for Interface
impl UnsafeUnpin for Interface
impl UnwindSafe for Interface
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.