#[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]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]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]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]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
Implementations§
Source§impl RemoteClaim
impl RemoteClaim
Sourcepub fn same_identity(&self, other: &Self) -> bool
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.
pub fn agent(agent_id: impl Into<String>) -> Self
pub fn worker( owner_module_id: impl Into<String>, worker_ref: impl Into<String>, on_behalf_of: Option<String>, ) -> Self
pub fn run(agent_id: impl Into<String>) -> Self
pub fn flow( flow_id: impl Into<String>, flow_version: u64, flow_install_id: impl Into<String>, flow_code_hash: impl Into<String>, ) -> Self
Sourcepub fn with_agent_name(self, name: impl Into<String>) -> Self
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.
Sourcepub fn with_flow_name(self, name: impl Into<String>) -> Self
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.