From abc778b456c99871a36f3bf6c7fc3305913c28d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 4 Feb 2022 14:53:32 +0100 Subject: Add Address::new MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller Signed-off-by: Matthias Beyer --- crates/core/tedge_api/src/address.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/core/tedge_api/src/address.rs') 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 }, } - - -- cgit v1.2.3