pub struct ApprovalRequest {Show 23 fields
pub id: String,
pub scope: ApprovalScope,
pub fingerprint: String,
pub tool_name: String,
pub origin: Option<ToolOrigin>,
pub args_redacted: Value,
pub evidence: Vec<Evidence>,
pub acting: Option<ActingContext>,
pub requester: Option<SubjectRef>,
pub summary: String,
pub risk: ApprovalRisk,
pub created_at: DateTime<Utc>,
pub expires_at: Option<DateTime<Utc>>,
pub allowed_actions: Vec<ApprovalAction>,
pub policy: ApprovalPolicy,
pub run_id: Option<String>,
pub version: u64,
pub state: ApprovalState,
pub decisions: Vec<ApprovalDecision>,
pub escalations_fired: u32,
pub resolved_at: Option<DateTime<Utc>>,
pub note: Option<String>,
pub outcome_applied: bool,
}Expand description
Core traits and types.
Always available regardless of feature flags. Includes:
Agent- The fundamental trait for all agentsTool/Toolset- For extending agents with capabilitiesSession/State- For managing conversation contextEvent- For streaming agent responsesAdkError/Result- Unified error handling A call waiting for approval, with its policy and the decisions made so far.
§Example
use adk_core::{ApprovalPolicy, ApprovalRequest, ApprovalRisk, ApprovalScope,
ApprovalState, ApproverSelector, ToolConfirmationRequest};
use serde_json::json;
let call = ToolConfirmationRequest {
tool_name: "refund".into(),
function_call_id: Some("call-1".into()),
args: json!({ "amount": 500, "card": "4242424242424242" }),
origin: None,
acting: None,
evidence: Vec::new(),
};
let request = ApprovalRequest::new(
"req-1",
ApprovalScope::new("shop", "u-1", "s-1"),
&call,
ApprovalPolicy::new([ApproverSelector::group("support-leads")]),
)
.with_summary("Refund 500 USD")
.with_risk(ApprovalRisk::High)
.with_redacted_args(json!({ "amount": 500, "card": "****4242" }));
assert_eq!(request.fingerprint, call.fingerprint());
assert_eq!(request.state, ApprovalState::Pending);Fields§
§id: StringStable identifier.
scope: ApprovalScopeThe session the call belongs to.
fingerprint: StringThe call’s fingerprint, the key its decision is recorded under.
tool_name: StringThe tool called.
origin: Option<ToolOrigin>Who publishes the tool, from the held call: a surface tells one publisher’s cards from
another’s by it, never by the tool’s name, which an MCP server can copy (spec 3.3 §7.1).
None for a call held without one, and for a request stored before the field existed.
args_redacted: ValueThe call’s arguments as shown to approvers, with secrets removed.
evidence: Vec<Evidence>What approvers see with the call, such as the exact image it would send: the held
call’s own evidence, whose digests its
fingerprint binds, then any the route added
(ApprovalRoute::evidence). Surfaces load each image through the artifact service
with the viewer’s own authorisation.
acting: Option<ActingContext>The agent making the call and on whose behalf.
requester: Option<SubjectRef>Who asked for the call; refused as an approver under
forbid_self_approval.
summary: StringOne line describing the call for approvers.
risk: ApprovalRiskHow much harm the call can do.
created_at: DateTime<Utc>When the request was submitted.
expires_at: Option<DateTime<Utc>>When the request expires.
allowed_actions: Vec<ApprovalAction>What approvers may do.
policy: ApprovalPolicyWho must approve.
run_id: Option<String>The durable run waiting for the decision, woken when the request resolves.
version: u64Incremented by every change; the compare-and-swap token for decisions.
state: ApprovalStateWhere the request is in its lifecycle.
decisions: Vec<ApprovalDecision>Decisions so far, oldest first.
escalations_fired: u32How many escalation steps have fired.
resolved_at: Option<DateTime<Utc>>When the request reached a terminal state.
note: Option<String>Why the request was cancelled or expired.
outcome_applied: boolWhether the resolution has been written to the store and the run woken.
Implementations§
Source§impl ApprovalRequest
impl ApprovalRequest
Sourcepub fn new(
id: impl Into<String>,
scope: ApprovalScope,
call: &ToolConfirmationRequest,
policy: ApprovalPolicy,
) -> ApprovalRequest
pub fn new( id: impl Into<String>, scope: ApprovalScope, call: &ToolConfirmationRequest, policy: ApprovalPolicy, ) -> ApprovalRequest
A pending request for call in scope under policy, allowing every action, with
the call’s origin.
Sourcepub fn id_for_call(
scope: &ApprovalScope,
fingerprint: &str,
held_since: DateTime<Utc>,
) -> String
pub fn id_for_call( scope: &ApprovalScope, fingerprint: &str, held_since: DateTime<Utc>, ) -> String
The deterministic ID of the request for the call with fingerprint, held in
scope since held_since.
A call held again before its decision keeps its hold time in the
ApprovalStore, so it maps to the same request; a call held after an earlier
decision gets a new one.
Sourcepub fn with_summary(self, summary: impl Into<String>) -> ApprovalRequest
pub fn with_summary(self, summary: impl Into<String>) -> ApprovalRequest
Sets the summary.
Sourcepub fn with_risk(self, risk: ApprovalRisk) -> ApprovalRequest
pub fn with_risk(self, risk: ApprovalRisk) -> ApprovalRequest
Sets the risk.
Sourcepub fn with_origin(self, origin: ToolOrigin) -> ApprovalRequest
pub fn with_origin(self, origin: ToolOrigin) -> ApprovalRequest
Names who publishes the tool (spec 3.3 §7.1).
§Example
use adk_core::{ApprovalPolicy, ApprovalRequest, ApprovalScope, ApproverSelector,
ToolConfirmationRequest, ToolOrigin};
use serde_json::json;
let call = ToolConfirmationRequest::new("verb_snooze", json!({ "item": "agenda-7" }));
let origin = ToolOrigin::new("verbs:adk-rust", &json!({ "name": "verb_snooze" }), None);
let request = ApprovalRequest::new(
"apr-1",
ApprovalScope::new("adk-rust", "ana", "s1"),
&call,
ApprovalPolicy::new([ApproverSelector::human("ana")]),
)
.with_origin(origin);
assert_eq!(request.origin.map(|origin| origin.source).as_deref(), Some("verbs:adk-rust"));Sourcepub fn with_redacted_args(self, args: Value) -> ApprovalRequest
pub fn with_redacted_args(self, args: Value) -> ApprovalRequest
Shows approvers args in place of the call’s arguments.
Sourcepub fn with_evidence(
self,
evidence: impl IntoIterator<Item = Evidence>,
) -> ApprovalRequest
pub fn with_evidence( self, evidence: impl IntoIterator<Item = Evidence>, ) -> ApprovalRequest
Shows approvers evidence after the call’s own. Only the call’s own evidence is part
of its fingerprint.
§Example
use adk_core::{
ApprovalPolicy, ApprovalRequest, ApprovalScope, ApproverSelector, ArtifactLocator,
Evidence, ImageEvidence, ToolConfirmationRequest,
};
use serde_json::json;
let image = |digest: &str, file: &str| {
Evidence::from(ImageEvidence::new(
digest,
ArtifactLocator::new("desk", "ana", "s1", file, 1),
"image/png",
640,
180,
))
};
let crop = image("sha256:aa", "egress/crop.png");
let call = ToolConfirmationRequest::new("vision_describe", json!({ "question": "Total?" }))
.with_evidence([crop.clone()]);
let overlay = image("sha256:bb", "egress/crop-regions.png");
let request = ApprovalRequest::new(
"apr-1",
ApprovalScope::new("desk", "ana", "s1"),
&call,
ApprovalPolicy::new([ApproverSelector::human("ana")]),
)
.with_evidence([overlay.clone()]);
assert_eq!(request.evidence, vec![crop, overlay]);
assert_eq!(request.fingerprint, call.fingerprint());Sourcepub fn with_acting(self, acting: ActingContext) -> ApprovalRequest
pub fn with_acting(self, acting: ActingContext) -> ApprovalRequest
Sets the acting context, and the requester to its on_behalf_of subject when no
requester is set.
Sourcepub fn with_requester(self, requester: SubjectRef) -> ApprovalRequest
pub fn with_requester(self, requester: SubjectRef) -> ApprovalRequest
Sets the requester.
Sourcepub fn with_run_id(self, run_id: impl Into<String>) -> ApprovalRequest
pub fn with_run_id(self, run_id: impl Into<String>) -> ApprovalRequest
Attaches the durable run waiting for the decision.
Sourcepub fn with_expires_at(self, at: DateTime<Utc>) -> ApprovalRequest
pub fn with_expires_at(self, at: DateTime<Utc>) -> ApprovalRequest
Sets the expiry.
Sourcepub fn with_allowed_actions(
self,
actions: impl IntoIterator<Item = ApprovalAction>,
) -> ApprovalRequest
pub fn with_allowed_actions( self, actions: impl IntoIterator<Item = ApprovalAction>, ) -> ApprovalRequest
Restricts what approvers may do.
Sourcepub fn shows_call_args(&self) -> bool
pub fn shows_call_args(&self) -> bool
Whether args_redacted are the call’s own arguments, so an
Edit that starts from them changes only what the approver
changed (spec 3.3 §7.2). False when the shown arguments are a redacted view, a form
an MCP server asks for, or anything else in place of the call’s, and for a request
without its fingerprint.
§Example
use adk_core::{
ApprovalPolicy, ApprovalRequest, ApprovalScope, ApproverSelector,
ToolConfirmationRequest,
};
use serde_json::json;
let call = ToolConfirmationRequest::new("pay", json!({ "amount": 500, "card": "4242424242424242" }));
let scope = ApprovalScope::new("shop", "ana", "s1");
let policy = ApprovalPolicy::new([ApproverSelector::human("ana")]);
let plain = ApprovalRequest::new("apr-1", scope.clone(), &call, policy.clone());
assert!(plain.shows_call_args());
let masked = ApprovalRequest::new("apr-2", scope, &call, policy)
.with_redacted_args(json!({ "amount": 500, "card": "****4242" }));
assert!(!masked.shows_call_args());Sourcepub fn is_open(&self) -> bool
pub fn is_open(&self) -> bool
Whether the request still needs work: pending, or resolved but not yet applied.
Sourcepub fn eligible_approvers(&self) -> impl Iterator<Item = &ApproverSelector>
pub fn eligible_approvers(&self) -> impl Iterator<Item = &ApproverSelector>
The approvers who may decide now: the policy’s approvers and slots, plus those of every fired escalation step.
Sourcepub fn is_eligible(&self, subject: &SubjectRef, groups: &[String]) -> bool
pub fn is_eligible(&self, subject: &SubjectRef, groups: &[String]) -> bool
Whether subject, a member of groups, is among the
eligible approvers.
Sourcepub fn is_self(&self, subject: &SubjectRef) -> bool
pub fn is_self(&self, subject: &SubjectRef) -> bool
Whether subject is the requester or the acting agent or its principal.
A human and a service with the same id are the same party: a run a scheduler
started for alice acts for service:alice, and human:alice may not approve it.
Sourcepub fn quorum_progress(&self) -> (Vec<SubjectRef>, Option<Value>)
pub fn quorum_progress(&self) -> (Vec<SubjectRef>, Option<Value>)
The authorities whose approvals count toward the quorum, and the arguments they
approved when an Edit substituted them.
An edit restarts the count: approvals before it approved other arguments.
Sourcepub fn open_slots(&self) -> Vec<&ApproverSelector>
pub fn open_slots(&self) -> Vec<&ApproverSelector>
The policy’s slots the counted approvals leave unfilled, each approver filling at most one: empty once every slot has its own approver.
§Example
use adk_core::principal::SubjectRef;
use adk_core::{ApprovalDecision, ApprovalPolicy, ApprovalRequest, ApprovalScope,
ApproverSelector, ToolConfirmationRequest};
use serde_json::json;
let call = ToolConfirmationRequest::new("site_publish", json!({ "draft": "draft-1" }));
let editor = ApproverSelector::group("role:editor");
let publisher = ApproverSelector::group("role:publisher");
let mut request = ApprovalRequest::new(
"apr-1",
ApprovalScope::new("bakery", "amina", "drafts"),
&call,
ApprovalPolicy::for_slots([editor.clone(), publisher.clone()]),
);
let mut eva = ApprovalDecision::approve(SubjectRef::human("eva"));
eva.authority_groups = vec!["role:editor".into(), "role:publisher".into()];
request.decisions.push(eva);
assert_eq!(request.open_slots().len(), 1, "eva fills one slot, not both");Sourcepub fn slot_holders(
&self,
) -> Vec<(&ApproverSelector, Option<&ApprovalDecision>)>
pub fn slot_holders( &self, ) -> Vec<(&ApproverSelector, Option<&ApprovalDecision>)>
Each of the policy’s slots, in order, with the counted approval that fills it: a maximum matching of distinct approvers to slots, so the order in which people decide never decides whether every slot can be filled.
§Example
use adk_core::principal::SubjectRef;
use adk_core::{ApprovalDecision, ApprovalPolicy, ApprovalRequest, ApprovalScope,
ApproverSelector, ToolConfirmationRequest};
use serde_json::json;
let call = ToolConfirmationRequest::new("site_publish", json!({ "draft": "draft-1" }));
let mut request = ApprovalRequest::new(
"apr-1",
ApprovalScope::new("bakery", "amina", "drafts"),
&call,
ApprovalPolicy::for_slots([
ApproverSelector::group("role:editor"),
ApproverSelector::group("role:publisher"),
]),
);
let mut eva = ApprovalDecision::approve(SubjectRef::human("eva"));
eva.authority_groups = vec!["role:editor".into(), "role:publisher".into()];
let mut ed = ApprovalDecision::approve(SubjectRef::human("ed"));
ed.authority_groups = vec!["role:editor".into()];
request.decisions.extend([eva, ed]);
let holders: Vec<Option<&str>> = request
.slot_holders()
.into_iter()
.map(|(_, holder)| holder.map(|decision| decision.authority().id.as_str()))
.collect();
assert_eq!(holders, [Some("ed"), Some("eva")], "eva moves to the publisher's slot");Sourcepub fn outcome(&self) -> Option<ToolApproval>
pub fn outcome(&self) -> Option<ToolApproval>
The decision the governed path takes for the call once the request resolved, or
None while it is pending.
Sourcepub fn cursor(&self) -> ApprovalCursor
pub fn cursor(&self) -> ApprovalCursor
The position of this request in listing order.
Trait Implementations§
Source§impl Clone for ApprovalRequest
impl Clone for ApprovalRequest
Source§fn clone(&self) -> ApprovalRequest
fn clone(&self) -> ApprovalRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ApprovalRequest
impl Debug for ApprovalRequest
Source§impl<'de> Deserialize<'de> for ApprovalRequest
impl<'de> Deserialize<'de> for ApprovalRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ApprovalRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ApprovalRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ApprovalRequest
Source§impl PartialEq for ApprovalRequest
impl PartialEq for ApprovalRequest
Source§impl Serialize for ApprovalRequest
impl Serialize for ApprovalRequest
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 ApprovalRequest
Auto Trait Implementations§
impl Forget for ApprovalRequest
impl Freeze for ApprovalRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<Evidence>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<SubjectRef>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
PhantomData<ApprovalAction>: Freeze,
PhantomData<ApproverSelector>: Freeze,
PhantomData<EscalationStep>: Freeze,
PhantomData<ApprovalDecision>: Freeze,
impl Move for ApprovalRequest
impl RefUnwindSafe for ApprovalRequest
impl Send for ApprovalRequest
impl Sync for ApprovalRequest
impl Unpin for ApprovalRequest
impl UnsafeUnpin for ApprovalRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<Evidence>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<SubjectRef>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
PhantomData<ApprovalAction>: UnsafeUnpin,
PhantomData<ApproverSelector>: UnsafeUnpin,
PhantomData<EscalationStep>: UnsafeUnpin,
PhantomData<ApprovalDecision>: UnsafeUnpin,
impl UnwindSafe for ApprovalRequestwhere
RawVecInner: UnwindSafe,
NonNull<u8>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
NonZero<i32>: UnwindSafe,
Utc: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.