Skip to main content

RemoteClaim

Enum RemoteClaim 

Source
#[non_exhaustive]
pub enum RemoteClaim {
#[non_exhaustive]
Agent { agent_id: String, agent_name: Option<String>, },
#[non_exhaustive]
Worker { owner_module_id: String, worker_ref: String, on_behalf_of: Option<String>, agent_name: Option<String>, },
#[non_exhaustive]
Run { agent_id: String, agent_name: Option<String>, },
#[non_exhaustive]
Flow { flow_id: String, flow_version: u64, flow_install_id: String, flow_code_hash: String, flow_name: Option<String>, }, }
Expand description

Identity asserted by the paired stack, not a local agent identity. Optional names are display-only. Use RemoteClaim::same_identity to compare callers without treating a display rename as a change of identity.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
Agent

Construct with RemoteClaim::agent so future fields can be added.

ⓘ
use subc_protocol::scope::RemoteClaim;
let _ = RemoteClaim::Agent { agent_id: "agent".into() };

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§agent_id: String
§agent_name: Option<String>
§

#[non_exhaustive]
Worker

Construct with RemoteClaim::worker so future fields can be added.

ⓘ
use subc_protocol::scope::RemoteClaim;
let _ = RemoteClaim::Worker { owner_module_id: "owner".into(), worker_ref: "a".repeat(64), on_behalf_of: None };

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§owner_module_id: String
§worker_ref: String
§on_behalf_of: Option<String>
§agent_name: Option<String>

Display name of the agent identified by on_behalf_of, not the worker.

§

#[non_exhaustive]
Run

Construct with RemoteClaim::run so future fields can be added.

ⓘ
use subc_protocol::scope::RemoteClaim;
let _ = RemoteClaim::Run { agent_id: "agent".into() };

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§agent_id: String
§agent_name: Option<String>
§

#[non_exhaustive]
Flow

Construct with RemoteClaim::flow so future fields can be added.

ⓘ
use subc_protocol::scope::RemoteClaim;
let _ = RemoteClaim::Flow { flow_id: "flow".into(), flow_version: 1, flow_install_id: "install".into(), flow_code_hash: "a".repeat(64) };

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§flow_id: String
§flow_version: u64
§flow_install_id: String
§flow_code_hash: String
§flow_name: Option<String>

Implementations§

Source§

impl RemoteClaim

Source

pub fn same_identity(&self, other: &Self) -> bool

Whether these claims identify the same caller. Compares every field except the display names, so a field added later counts as identity unless it is cleared here too. Ordinary equality remains structural.

Source

pub fn agent(agent_id: impl Into<String>) -> Self

Source

pub fn worker( owner_module_id: impl Into<String>, worker_ref: impl Into<String>, on_behalf_of: Option<String>, ) -> Self

Source

pub fn run(agent_id: impl Into<String>) -> Self

Source

pub fn flow( flow_id: impl Into<String>, flow_version: u64, flow_install_id: impl Into<String>, flow_code_hash: impl Into<String>, ) -> Self

Source

pub fn with_agent_name(self, name: impl Into<String>) -> Self

Set the claimed agent’s display name (or the worker’s on_behalf_of agent). Invalid names are dropped. Has no effect on flow claims.

Source

pub fn with_flow_name(self, name: impl Into<String>) -> Self

Set the flow’s display name. Invalid names are dropped. Has no effect on agent, run or worker claims.

Source

pub fn validate(&self) -> Result<(), String>

Check identity fields, including the shared opaque-token bounds. Display names never invalidate a claim; decoders drop invalid names.

Trait Implementations§

Source§

impl Clone for RemoteClaim

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RemoteClaim

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RemoteClaim

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for RemoteClaim

Source§

impl PartialEq for RemoteClaim

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RemoteClaim

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RemoteClaim

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.