weave-identity · identity
Source declarations, signatures and documentation for identity.
Source: sigil/weave/adapters/weave-identity/src/identity.rs. SHA-256: c973a80e336db83a0d2f60cd148483b923b5e08350880f38f990737234416e8a.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
identity::IdentityType
The type of a Weave identity
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum IdentityType {
/// Human-controlled identity
Human,
/// Agent-controlled identity (e.g. bot, service)
Agent,
/// Autonomous Organization identity
AutonomousOrganization,
}Source line: 9.
identity::IdentityType::from_str_name
Create from a string name
pub fn from_str_name(s: &str) -> Result<Self>;Source line: 20.
identity::IdentityType::to_string
Convert to string
pub fn to_string(&self) -> &'static str;Source line: 30.
identity::IdentityType::as_str
Convert to string (alias for compatibility)
pub fn as_str(&self) -> &'static str;Source line: 39.
identity::Identity
Represents a Weave identity
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Identity {
}Source line: 54.
identity::Identity::new
Create a new identity
pub fn new(id: String, identity_type: IdentityType, public_key: Vec<u8>) -> Self;Source line: 65.
identity::Identity::id
Get the identity string
pub fn id(&self) -> &str;Source line: 74.
identity::Identity::identity_type
Get the identity type
pub fn identity_type(&self) -> IdentityType;Source line: 79.
identity::Identity::public_key
Get the public key bytes
pub fn public_key(&self) -> &[u8];Source line: 84.
identity::Identity::agent_from_public_key
Create an agent identity from public key
pub fn agent_from_public_key(public_key: Vec<u8>, instance_id: Option<&str>) -> Result<Self>;Source line: 89.
identity::Identity::ao_from_public_key
Create an AO identity from public key
pub fn ao_from_public_key(public_key: Vec<u8>, org_name: &str) -> Result<Self>;Source line: 95.
identity::Identity::human_from_public_key
Create a human identity from public key
pub fn human_from_public_key(public_key: Vec<u8>) -> Result<Self>;Source line: 105.
identity::Identity::from_did
Parse a DID string into an identity.
Accepts both did:oas:l1fe:<kind>:<id> and did:l1fe:<kind>:<id> formats.
pub fn from_did(did: &str) -> Result<Self>;Source line: 112.
identity::Identity::validate_did
Validate DID format — accepts both did:oas:l1fe:* and did:l1fe:* formats.
pub fn validate_did(did: &str) -> Result<bool>;Source line: 138.
identity::Identity::is_agent
Check if this identity is an agent
pub fn is_agent(&self) -> bool;Source line: 184.
identity::Identity::is_ao
Check if this identity is an AO
pub fn is_ao(&self) -> bool;Source line: 189.
identity::Identity::is_human
Check if this identity is a human
pub fn is_human(&self) -> bool;Source line: 194.