pub struct Resolver<'a> {
pub principal: &'a str,
pub agent_id: Option<&'a str>,
}Expand description
Who is resolving an approval.
resolve_approval used to take a bare caller_client_id: &str, and that
parameter was overloaded: WebSocket callers passed a session client id,
while the messaging adapters passed a transport principal literal
(slack-transport, imessage-transport). Nothing in the type said which,
so nothing could ask the question the approval surface most needs to ask —
is the thing resolving this the same thing that asked for it?
CreateHostApprovalRequest::system_level has always documented the answer
as intent (“‘the user’ … is the resolver, not the requesting agent itself”)
and no code enforced it. This type is the prerequisite for enforcing it; see
docs/proposals/human-oversight-affordances.md slice 4.
Fields§
§principal: &'a strThe session client id, or the transport principal literal. This is what
the ownership check compares against, so it keeps the exact meaning the
old caller_client_id had.
agent_id: Option<&'a str>The agent this resolver is, when the resolver is a session bound to
one. None for a human host client and for an approval transport —
neither of which is an agent, which is the whole point.
Implementations§
Source§impl<'a> Resolver<'a>
impl<'a> Resolver<'a>
Sourcepub fn session(client_id: &'a str) -> Resolver<'a>
pub fn session(client_id: &'a str) -> Resolver<'a>
A WebSocket session not bound to an agent — a host client (CarHost,
car-host approve), i.e. a person.
Trait Implementations§
impl<'a> Copy for Resolver<'a>
impl<'a> Eq for Resolver<'a>
impl<'a> StructuralPartialEq for Resolver<'a>
Auto Trait Implementations§
impl<'a> Freeze for Resolver<'a>
impl<'a> RefUnwindSafe for Resolver<'a>
impl<'a> Send for Resolver<'a>
impl<'a> Sync for Resolver<'a>
impl<'a> Unpin for Resolver<'a>
impl<'a> UnsafeUnpin for Resolver<'a>
impl<'a> UnwindSafe for Resolver<'a>
Blanket Implementations§
impl<T> Boilerplate 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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