pub enum MemberId {
Person(PersonId),
Agent {
id: String,
person: PersonId,
},
Bot(String),
}Expand description
A person, agent or bot in a workspace.
Variants§
Person(PersonId)
A person, by their root public key (PersonId).
Agent
An agent: its id and the person it acts for, whom its certificate chains to. The pair is
the agent: scout acting for one person and scout acting for another are two members,
each with its own person’s reach, answers and stops.
Bot(String)
Implementations§
Source§impl MemberId
impl MemberId
Sourcepub fn mark_value(&self) -> String
pub fn mark_value(&self) -> String
The value a text mark naming this member holds, in the one form: the id as JSON
({"person":…}). A mention in any text is stored as this.
Sourcepub fn of_mark_value(value: &str) -> Option<MemberId>
pub fn of_mark_value(value: &str) -> Option<MemberId>
The member a text mark’s value names (Self::mark_value); None for a value
naming anything else.
Sourcepub fn direct_conversation(
members: impl IntoIterator<Item = MemberId>,
) -> String
pub fn direct_conversation( members: impl IntoIterator<Item = MemberId>, ) -> String
The id of the one direct conversation with exactly members, as every
app that reads or writes conversations spells it: derived from the
set, so two devices that open the same conversation at once make one,
and neither has to create it first.
pub fn person(id: impl Into<PersonId>) -> MemberId
Sourcepub fn parsed_person(id: &str) -> Option<MemberId>
pub fn parsed_person(id: &str) -> Option<MemberId>
id as a person, when it is a person’s bare root key: an id read from
stored data or another device, which Self::person would panic on.
Sourcepub fn agent(id: impl Into<String>, person: impl Into<PersonId>) -> MemberId
pub fn agent(id: impl Into<String>, person: impl Into<PersonId>) -> MemberId
The agent id acting for person.
pub fn bot(id: impl Into<String>) -> MemberId
pub fn agent_id(&self) -> Option<&str>
Sourcepub fn agent_person(&self) -> Option<&PersonId>
pub fn agent_person(&self) -> Option<&PersonId>
The person an agent acts for, when this is an agent.
Sourcepub fn as_agent(&self) -> Option<(&str, &PersonId)>
pub fn as_agent(&self) -> Option<(&str, &PersonId)>
The agent’s id and its person, when this is an agent.
pub fn bot_id(&self) -> Option<&str>
pub const fn is_person(&self) -> bool
pub const fn is_agent(&self) -> bool
pub const fn is_bot(&self) -> bool
Sourcepub fn actor_bytes(&self) -> Vec<u8> ⓘ
pub fn actor_bytes(&self) -> Vec<u8> ⓘ
The bytes a document names this member’s changes by: a person’s root key as written, an
agent’s agent:<person>/<id>, a bot’s bot:<id>, as history reads them back.
Sourcepub fn of_actor_bytes(bytes: &[u8]) -> Option<MemberId>
pub fn of_actor_bytes(bytes: &[u8]) -> Option<MemberId>
The member whose changes a document names by bytes (Self::actor_bytes); None for
bytes no member writes as.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MemberId
impl<'de> Deserialize<'de> for MemberId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MemberId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MemberId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for MemberId
Source§impl Ord for MemberId
impl Ord for MemberId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for MemberId
impl PartialOrd for MemberId
Source§impl Serialize for MemberId
impl Serialize for MemberId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for MemberId
Auto Trait Implementations§
impl Forget for MemberId
impl Freeze for MemberId
impl Move for MemberId
impl RefUnwindSafe for MemberId
impl Send for MemberId
impl Sync for MemberId
impl Unpin for MemberId
impl UnsafeUnpin for MemberId
impl UnwindSafe for MemberId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more