Skip to content

Commit

Permalink
Merge pull request #8 from re-gmbh/feature/ord-node-id
Browse files Browse the repository at this point in the history
Derive Ord for NodeId
  • Loading branch information
AlexH-re authored May 6, 2024
2 parents 87a3d6e + 1627645 commit f1a8876
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/types/byte_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::types::{
};

/// A sequence of octets.
#[derive(Eq, PartialEq, Debug, Clone, Hash, Serialize, Deserialize)]
#[derive(Eq, PartialEq, Debug, Clone, Hash, Serialize, Deserialize, PartialOrd, Ord)]
pub struct ByteString {
pub value: Option<Vec<u8>>,
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/types/guid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use uuid::Uuid;
use crate::types::encoding::*;

/// A Guid is a 16 byte Globally Unique Identifier.
#[derive(Eq, PartialEq, Clone, Hash)]
#[derive(Eq, PartialEq, Clone, Hash, PartialOrd, Ord)]
pub struct Guid {
uuid: Uuid,
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/types/node_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::types::{
};

/// The kind of identifier, numeric, string, guid or byte
#[derive(Eq, PartialEq, Clone, Debug, Hash, Serialize, Deserialize)]
#[derive(Eq, PartialEq, Clone, Debug, Hash, Serialize, Deserialize, PartialOrd, Ord)]
pub enum Identifier {
Numeric(u32),
String(UAString),
Expand Down Expand Up @@ -123,7 +123,7 @@ impl fmt::Display for NodeIdError {
impl std::error::Error for NodeIdError {}

/// An identifier for a node in the address space of an OPC UA Server.
#[derive(PartialEq, Eq, Clone, Debug, Hash, Serialize, Deserialize)]
#[derive(PartialEq, Eq, Clone, Debug, Hash, Serialize, Deserialize, PartialOrd, Ord)]
pub struct NodeId {
/// The index for a namespace
pub namespace: u16,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/types/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::types::{
/// A string contains UTF-8 encoded characters or a null value. A null value is distinct from
/// being an empty string so internally, the code maintains that distinction by holding the value
/// as an `Option<String>`.
#[derive(Eq, PartialEq, Debug, Clone, Hash, Serialize, Deserialize)]
#[derive(Eq, PartialEq, Debug, Clone, Hash, Serialize, Deserialize, PartialOrd, Ord)]
pub struct UAString {
value: Option<String>,
}
Expand Down

0 comments on commit f1a8876

Please sign in to comment.