pub struct PluginTypeId(/* private fields */);Expand description
Opaque plugin type identifier — validated at the catalog boundary.
Uses Cow<'static, str> so well-known constants are zero-allocation borrows
while DB/wire values are owned strings. Both are the same type.
This replaces PluginType enum. Instead of matching on variants, code looks up
the PluginTypeId in the PluginCatalog to get a PluginDescriptor.
Implementations§
Source§impl PluginTypeId
impl PluginTypeId
Sourcepub const fn from_static(s: &'static str) -> PluginTypeId
pub const fn from_static(s: &'static str) -> PluginTypeId
Const constructor for well-known identifiers. Zero allocation.
Sourcepub fn new(s: impl Into<String>) -> PluginTypeId
pub fn new(s: impl Into<String>) -> PluginTypeId
Runtime constructor for DB/wire values. Allocates.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl AsRef<str> for PluginTypeId
impl AsRef<str> for PluginTypeId
Source§impl Clone for PluginTypeId
impl Clone for PluginTypeId
Source§fn clone(&self) -> PluginTypeId
fn clone(&self) -> PluginTypeId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginTypeId
impl Debug for PluginTypeId
Source§impl<'de> Deserialize<'de> for PluginTypeId
impl<'de> Deserialize<'de> for PluginTypeId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PluginTypeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PluginTypeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PluginTypeId
impl Display for PluginTypeId
impl Eq for PluginTypeId
Source§impl From<&str> for PluginTypeId
impl From<&str> for PluginTypeId
Source§fn from(s: &str) -> PluginTypeId
fn from(s: &str) -> PluginTypeId
Converts to this type from the input type.
Source§impl From<String> for PluginTypeId
impl From<String> for PluginTypeId
Source§fn from(s: String) -> PluginTypeId
fn from(s: String) -> PluginTypeId
Converts to this type from the input type.
Source§impl FromStr for PluginTypeId
impl FromStr for PluginTypeId
Source§type Err = Infallible
type Err = Infallible
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<PluginTypeId, <PluginTypeId as FromStr>::Err>
fn from_str(s: &str) -> Result<PluginTypeId, <PluginTypeId as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for PluginTypeId
impl Hash for PluginTypeId
Source§impl PartialEq for PluginTypeId
impl PartialEq for PluginTypeId
Source§fn eq(&self, other: &PluginTypeId) -> bool
fn eq(&self, other: &PluginTypeId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<&str> for PluginTypeId
impl PartialEq<&str> for PluginTypeId
Source§impl PartialEq<str> for PluginTypeId
impl PartialEq<str> for PluginTypeId
Source§impl Serialize for PluginTypeId
impl Serialize for PluginTypeId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PluginTypeId
Auto Trait Implementations§
impl Freeze for PluginTypeId
impl RefUnwindSafe for PluginTypeId
impl Send for PluginTypeId
impl Sync for PluginTypeId
impl Unpin for PluginTypeId
impl UnsafeUnpin for PluginTypeId
impl UnwindSafe for PluginTypeId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.