Enum wick_packet::Entity
source · pub enum Entity {
Invalid,
Test(String),
Server(String),
Operation(String, String),
Component(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.
Test(String)
A [SystemEntity] with the name “test”. Used as the originating entity for tests.
Server(String)
A client entity used for requests.
Operation(String, String)
A component or anything that can be invoked like a component.
Component(String)
A collection of components.
Implementations§
source§impl Entity
impl Entity
sourcepub fn operation<T: AsRef<str>, U: AsRef<str>>(ns: T, name: U) -> Self
pub fn operation<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 test<T: AsRef<str>>(msg: T) -> Self
pub fn test<T: AsRef<str>>(msg: T) -> Self
Constructor for an Entity::Test.
sourcepub fn component<T: AsRef<str>>(id: T) -> Self
pub fn component<T: AsRef<str>>(id: T) -> Self
Constructor for an Entity::Component.
sourcepub fn server<T: AsRef<str>>(id: T) -> Self
pub fn server<T: AsRef<str>>(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(&mut self, id: impl AsRef<str>)
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