#[non_exhaustive]pub enum Entity {
Invalid,
Test(String),
Server(String),
Operation(String, String),
Component(String),
}
Expand description
The entity being referenced across systems or services.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Invalid
An invalid entity. Used only for situations where a default is necessary.
Test(String)
A “test” entity. Used as the originating entity for tests.
Server(String)
A server or host entity (i.e. for requests).
Operation(String, String)
An operation or anything that can be invoked like an operation.
Component(String)
A component that hosts a collection of operations.
Implementations§
Source§impl Entity
impl Entity
Sourcepub fn operation<T: Into<String>, U: Into<String>>(ns: T, name: U) -> Self
pub fn operation<T: Into<String>, U: Into<String>>(ns: T, name: U) -> Self
Constructor for Entity::Component.
Sourcepub fn local<T: Into<String>>(name: T) -> Self
pub fn local<T: Into<String>>(name: T) -> Self
Constructor for Entity::Component on the local namespace, used when the namespace is irrelevant. Caution: this is not portable.
Sourcepub fn test<T: Into<String>>(msg: T) -> Self
pub fn test<T: Into<String>>(msg: T) -> Self
Constructor for an Entity::Test.
Sourcepub fn component<T: Into<String>>(id: T) -> Self
pub fn component<T: Into<String>>(id: T) -> Self
Constructor for an Entity::Component.
Sourcepub fn server<T: Into<String>>(id: T) -> Self
pub fn server<T: Into<String>>(id: T) -> Self
Constructor for Entity::Server.
Sourcepub fn operation_id(&self) -> &str
pub fn operation_id(&self) -> &str
The name of the entity.
pub fn set_operation<T: Into<String>>(&mut self, id: T)
Sourcepub fn component_id(&self) -> &str
pub fn component_id(&self) -> &str
The id of the component entity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entity
impl<'de> Deserialize<'de> for Entity
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
impl StructuralPartialEq for Entity
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnwindSafe for Entity
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