pub struct PluginIdentity {
pub magic: [u8; 8],
pub abi_envelope: u32,
pub plugin_name: String,
pub plugin_version: String,
}Expand description
Identity metadata for a cc-lb plugin.
This struct is serialized into a WASM custom section and used to validate plugin compatibility and metadata before instantiation.
Fields§
§magic: [u8; 8]8-byte magic number that must match CC_LB_PLUGIN_MAGIC.
abi_envelope: u32ABI envelope version or compatibility identifier.
plugin_name: StringPlugin name: lowercase alphanumeric, underscore, and hyphen; max 64 bytes.
plugin_version: StringPlugin semantic version string; max 32 bytes.
Implementations§
Source§impl PluginIdentity
impl PluginIdentity
Sourcepub fn validate(&self) -> Result<(), IdentityError>
pub fn validate(&self) -> Result<(), IdentityError>
Validate this identity against required constraints.
Checks:
- magic matches CC_LB_PLUGIN_MAGIC
- plugin_name matches ^[a-z][a-z0-9_-]*$ and is at most 64 bytes
- plugin_version is at most 32 bytes and not empty
Trait Implementations§
Source§impl Clone for PluginIdentity
impl Clone for PluginIdentity
Source§fn clone(&self) -> PluginIdentity
fn clone(&self) -> PluginIdentity
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 PluginIdentity
impl Debug for PluginIdentity
Source§impl<'de> Deserialize<'de> for PluginIdentity
impl<'de> Deserialize<'de> for PluginIdentity
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 Eq for PluginIdentity
Source§impl PartialEq for PluginIdentity
impl PartialEq for PluginIdentity
Source§fn eq(&self, other: &PluginIdentity) -> bool
fn eq(&self, other: &PluginIdentity) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PluginIdentity
impl Serialize for PluginIdentity
impl StructuralPartialEq for PluginIdentity
Auto Trait Implementations§
impl Freeze for PluginIdentity
impl RefUnwindSafe for PluginIdentity
impl Send for PluginIdentity
impl Sync for PluginIdentity
impl Unpin for PluginIdentity
impl UnsafeUnpin for PluginIdentity
impl UnwindSafe for PluginIdentity
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