[][src]Struct holochain_core_types::agent::AgentId

pub struct AgentId {
    pub nick: String,
    pub pub_sign_key: Base32,
}

AgentId represents an agent in the Holochain framework. This data struct is meant be stored in the CAS and source-chain. Its key is the public signing key, and is also used as its address.

Fields

nick: String

a nickname for referencing this agent

pub_sign_key: Base32

the encoded public signing key of this agent (the magnifier)

Methods

impl AgentId[src]

pub const FAKE_RAW_KEY: [u8; 32][src]

A well-known key useful for testing and used by generate_fake()

pub fn generate_fake(nick: &str) -> Self[src]

generate an agent id with fake key

pub fn new_with_raw_key(nick: &str, key: &str) -> HcResult<Self>[src]

initialize an Agent struct with nick and key that will be encoded with HCID.

pub fn new(nick: &str, key_b32: Base32) -> Self[src]

initialize an Agent struct with nick and a HCID encoded key.

pub fn decoded_key(&self) -> HcResult<String>[src]

Get the key decoded with HCID

Trait Implementations

impl AddressableContent for AgentId[src]

fn address(&self) -> Address[src]

for an Agent, the address is their public base32 encoded public signing key string

fn content(&self) -> Content[src]

get the entry content

impl Clone for AgentId[src]

impl Debug for AgentId[src]

impl<'de> Deserialize<'de> for AgentId[src]

impl Eq for AgentId[src]

impl<'a> From<&'a AgentId> for JsonString[src]

impl From<AgentId> for JsonString[src]

impl PartialEq<AgentId> for AgentId[src]

impl Serialize for AgentId[src]

impl StructuralEq for AgentId[src]

impl StructuralPartialEq for AgentId[src]

impl<'a> TryFrom<&'a JsonString> for AgentId[src]

type Error = JsonError

The type returned in the event of a conversion error.

impl TryFrom<JsonString> for AgentId[src]

type Error = JsonError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for AgentId

impl Send for AgentId

impl Sync for AgentId

impl Unpin for AgentId

impl UnwindSafe for AgentId

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clone for T where
    T: Clone
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,