Struct ParticipantId
pub struct ParticipantId(/* private fields */);Expand description
One participant in a shared record: a person’s window or an agent task.
Each participant owns its own view state (caret, selection, Find), and the
app builds that participant’s resource tree from it
(the toolkit’s PublishesResources::resources_for).
Opaque, non-empty, ASCII-printable and at most
MAX_PARTICIPANT_ID_BYTES bytes. It is a routing key for view state,
never authority: the authenticated principal is ActionInvoker::actor.
Implementations§
§impl ParticipantId
impl ParticipantId
pub fn new(id: impl Into<String>) -> Result<ParticipantId, String>
pub fn new(id: impl Into<String>) -> Result<ParticipantId, String>
Validate and wrap a participant id.
§Errors
Returns a description when id is empty, longer than
MAX_PARTICIPANT_ID_BYTES, or not printable ASCII.
pub fn as_str(&self) -> &str
pub fn for_agent_task(task_id: &str) -> Result<ParticipantId, String>
pub fn for_agent_task(task_id: &str) -> Result<ParticipantId, String>
The participant of one agent task. Only the host derives it, from the task it admitted (never from anything the agent sends), so an agent can address only the view of the task it runs.
§Errors
Returns a description when the derived id is not a valid participant
id (see ParticipantId::new).
pub fn for_execution(execution: Uuid) -> ParticipantId
pub fn for_execution(execution: Uuid) -> ParticipantId
One host-minted execution’s private view. This key is subordinate to the admitted principal and confers no authority. Hosts derive it from their execution lease, never a client-supplied run label or context.
pub fn agent_task(&self) -> Option<&str>
pub fn agent_task(&self) -> Option<&str>
The task id of a host-derived agent task participant.
Trait Implementations§
§impl Clone for ParticipantId
impl Clone for ParticipantId
§fn clone(&self) -> ParticipantId
fn clone(&self) -> ParticipantId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ParticipantId
impl Debug for ParticipantId
§impl<'de> Deserialize<'de> for ParticipantId
impl<'de> Deserialize<'de> for ParticipantId
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParticipantId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParticipantId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for ParticipantId
impl Display for ParticipantId
§impl From<ParticipantId> for String
impl From<ParticipantId> for String
§fn from(value: ParticipantId) -> String
fn from(value: ParticipantId) -> String
§impl Hash for ParticipantId
impl Hash for ParticipantId
§impl Ord for ParticipantId
impl Ord for ParticipantId
§fn cmp(&self, other: &ParticipantId) -> Ordering
fn cmp(&self, other: &ParticipantId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for ParticipantId
impl PartialEq for ParticipantId
§impl PartialOrd for ParticipantId
impl PartialOrd for ParticipantId
§impl Serialize for ParticipantId
impl Serialize for ParticipantId
§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 TryFrom<String> for ParticipantId
impl TryFrom<String> for ParticipantId
impl Eq for ParticipantId
impl StructuralPartialEq for ParticipantId
Auto Trait Implementations§
impl Freeze for ParticipantId
impl RefUnwindSafe for ParticipantId
impl Send for ParticipantId
impl Sync for ParticipantId
impl Unpin for ParticipantId
impl UnsafeUnpin for ParticipantId
impl UnwindSafe for ParticipantId
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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