pub struct Identity {
pub id: String,
pub display_name: Option<String>,
pub email: Option<Email>,
pub signing_key: Option<SigningKey>,
pub created_at: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
A verified individual identity within the GID system.
Identities represent human actors (developers, reviewers, approvers) who participate in rituals and approve phase transitions.
Fields§
§id: StringUnique identifier (slug), e.g. “alice” or “bob-smith”.
display_name: Option<String>Human-readable display name.
email: Option<Email>Validated email address.
signing_key: Option<SigningKey>Signing key fingerprint for commit/artifact verification.
created_at: DateTime<Utc>When this identity was created.
metadata: HashMap<String, String>Arbitrary key-value metadata.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn new(id: &str) -> Result<Self, IdentityError>
pub fn new(id: &str) -> Result<Self, IdentityError>
Create a minimal identity with just an id.
Sourcepub fn builder(id: &str) -> IdentityBuilder
pub fn builder(id: &str) -> IdentityBuilder
Start building an identity with a fluent API.
Sourcepub fn set_email(&mut self, email: &str) -> Result<(), IdentityError>
pub fn set_email(&mut self, email: &str) -> Result<(), IdentityError>
Set the email, validating it.
Sourcepub fn set_signing_key(
&mut self,
fingerprint: &str,
) -> Result<(), IdentityError>
pub fn set_signing_key( &mut self, fingerprint: &str, ) -> Result<(), IdentityError>
Set the signing key, validating the fingerprint.
Sourcepub fn has_signing_key(&self) -> bool
pub fn has_signing_key(&self) -> bool
Check whether this identity has a signing key.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Identity
impl<'de> Deserialize<'de> for Identity
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 Identity
impl StructuralPartialEq for Identity
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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,
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.