MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_identity

Method with_identity

atomic-core/src/change/header.rs:107–117  ·  view source on GitHub ↗

Create an author with an associated cryptographic identity. # Arguments `name` - The author's display name `email` - Optional email address `identity` - Identity key reference (e.g., base32-encoded public key) # Examples ```rust use atomic_core::change::Author; let author = Author::with_identity( "Alice", Some("alice@example.com"), "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRST", ); as

(
        name: impl Into<String>,
        email: Option<impl Into<String>>,
        identity: impl Into<String>,
    )

Source from the content-addressed store, hash-verified

105 /// assert!(author.identity.is_some());
106 /// ```
107 pub fn with_identity(
108 name: impl Into<String>,
109 email: Option<impl Into<String>>,
110 identity: impl Into<String>,
111 ) -> Self {
112 Self {
113 name: name.into(),
114 email: email.map(Into::into),
115 identity: Some(identity.into()),
116 }
117 }
118
119 /// Check if this author has an associated identity.
120 #[inline]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected