diff options
author | Marcel Müller <m.mueller@ifm.com> | 2022-02-04 14:53:32 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-03-04 15:03:53 +0100 |
commit | abc778b456c99871a36f3bf6c7fc3305913c28d2 (patch) | |
tree | b9f788c4bf2ee0b420e57d5a9282fb2ce4022fb6 /crates/core/tedge_api/src/address.rs | |
parent | 4d54dcf73fb14341e35b8a9a2fc2cca05c1cb0b5 (diff) |
Add Address::new
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Diffstat (limited to 'crates/core/tedge_api/src/address.rs')
-rw-r--r-- | crates/core/tedge_api/src/address.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/core/tedge_api/src/address.rs b/crates/core/tedge_api/src/address.rs index 96239216..3e215211 100644 --- a/crates/core/tedge_api/src/address.rs +++ b/crates/core/tedge_api/src/address.rs @@ -9,6 +9,13 @@ pub struct Address { } impl Address { + pub fn new(endpoint: EndpointKind) -> Address { + Self { + endpoint, + source: None, + } + } + /// Get the original source of an `Address` pub fn origin(&self) -> &Address { if let Some(source) = self.source.as_ref() { @@ -34,5 +41,3 @@ pub enum EndpointKind { /// A specific plugin Plugin { id: String }, } - - |