pub enum Entity {
Invalid,
System(SystemEntity),
Test(String),
Client(String),
Host(String),
Component(String, String),
Collection(String),
Reference(String),
}Expand description
The entity being referenced across systems or services.
Variants§
Invalid
A SystemEntity with the name “invalid”. Used only for situations where a default is necessary.
System(SystemEntity)
The SystemEntity is used when communicating to or from the internals of another component. Used mostly by library developers.
Test(String)
A SystemEntity with the name “test”. Used as the originating entity for tests.
Client(String)
A client entity used for requests.
Host(String)
A Host entity used for entities that serve responses to requests.
Component(String, String)
A component or anything that can be invoked like a component.
Collection(String)
A collection of components.
Reference(String)
A reference to an instance of an entity.
Implementations§
Source§impl Entity
impl Entity
Sourcepub fn component<T: AsRef<str>, U: AsRef<str>>(ns: T, name: U) -> Self
pub fn component<T: AsRef<str>, U: AsRef<str>>(ns: T, name: U) -> Self
Constructor for Entity::Component.
Sourcepub fn local<T: AsRef<str>>(name: T) -> Self
pub fn local<T: AsRef<str>>(name: T) -> Self
Constructor for Entity::Component on the local namespace, used when the namespace is irrelevant. Caution: this is not portable.
Sourcepub fn component_direct<T: AsRef<str>>(name: T) -> Self
👎Deprecated: please use local() instead
pub fn component_direct<T: AsRef<str>>(name: T) -> Self
local() insteadConstructor for Entity::Component without a namespace, used when the namespace is irrelevant. Caution: this is not portable.
Sourcepub fn system<T: AsRef<str>, U: AsRef<str>>(name: T, value: U) -> Self
pub fn system<T: AsRef<str>, U: AsRef<str>>(name: T, value: U) -> Self
Constructor for Entity::System.
Sourcepub fn test<T: AsRef<str>>(msg: T) -> Self
pub fn test<T: AsRef<str>>(msg: T) -> Self
Constructor for an Entity::Test.
Sourcepub fn collection<T: AsRef<str>>(id: T) -> Self
pub fn collection<T: AsRef<str>>(id: T) -> Self
Constructor for an Entity::Collection.
Sourcepub fn host<T: AsRef<str>>(id: T) -> Self
pub fn host<T: AsRef<str>>(id: T) -> Self
Constructor for Entity::Host.
Sourcepub fn client<T: AsRef<str>>(id: T) -> Self
pub fn client<T: AsRef<str>>(id: T) -> Self
Constructor for Entity::Client.
Sourcepub fn reference<T: AsRef<str>>(id: T) -> Self
pub fn reference<T: AsRef<str>>(id: T) -> Self
Constructor for Entity::Client.