Struct svc_agent::AgentId [−][src]
pub struct AgentId { /* fields omitted */ }Expand description
Agent identifier.
It consists of a string label and AccountId and must be unique.
Multiple agents may use the same AccountId, e.g. multiple instances
of the same service or multiple devices or browser tabs of an end user, but the label
must be different across them. An agent identifier has to be unique, otherwise it gets
disconnected by the broker. You can safely use the same label if
AccountId is different.
Implementations
impl AgentId[src]
impl AgentId[src]pub fn new(label: &str, account_id: AccountId) -> Self[src]
pub fn new(label: &str, account_id: AccountId) -> Self[src]Builds an AgentId.
Arguments
-
label– a unique string to identify the particular agent. For example the name of a service instance or a user device. -
account_id– the account identifier of an agent.
Example
let agent_id1 = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let agent_id2 = AgentId::new("web", AccountId::new("user_name", "usr.example.org"));
pub fn label(&self) -> &str[src]
Trait Implementations
impl Addressable for AgentId[src]
impl Addressable for AgentId[src]fn as_agent_id(&self) -> &Self[src]
fn as_agent_id(&self) -> &Self[src]Returns the AgentId reference of the addressable object.
impl Authenticable for AgentId[src]
impl Authenticable for AgentId[src]fn as_account_id(&self) -> &AccountId[src]
impl<'de> Deserialize<'de> for AgentId[src]
impl<'de> Deserialize<'de> for AgentId[src]fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]Deserialize this value from the given Serde deserializer. Read more
impl Eq for AgentId[src]
impl StructuralEq for AgentId[src]
impl StructuralPartialEq for AgentId[src]
Auto Trait Implementations
impl RefUnwindSafe for AgentId
impl Send for AgentId
impl Sync for AgentId
impl Unpin for AgentId
impl UnwindSafe for AgentId
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,