pub struct GraphAgentBuilder { /* private fields */ }graph only.Expand description
Builder for GraphAgent
Implementations§
Source§impl GraphAgentBuilder
impl GraphAgentBuilder
Sourcepub fn new(name: &str) -> GraphAgentBuilder
pub fn new(name: &str) -> GraphAgentBuilder
Create a new builder
Sourcepub fn description(self, desc: &str) -> GraphAgentBuilder
pub fn description(self, desc: &str) -> GraphAgentBuilder
Set description
Sourcepub fn state_schema(self, schema: StateSchema) -> GraphAgentBuilder
pub fn state_schema(self, schema: StateSchema) -> GraphAgentBuilder
Set state schema
Sourcepub fn channels(self, channels: &[&str]) -> GraphAgentBuilder
pub fn channels(self, channels: &[&str]) -> GraphAgentBuilder
Add channels to state schema
Sourcepub fn node<N>(self, node: N) -> GraphAgentBuilderwhere
N: Node + 'static,
pub fn node<N>(self, node: N) -> GraphAgentBuilderwhere
N: Node + 'static,
Add a node
Sourcepub fn node_fn<F, Fut>(self, name: &str, func: F) -> GraphAgentBuilderwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput, GraphError>> + Send + 'static,
pub fn node_fn<F, Fut>(self, name: &str, func: F) -> GraphAgentBuilderwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput, GraphError>> + Send + 'static,
Add a function as a node
Sourcepub fn edge(self, source: &str, target: &str) -> GraphAgentBuilder
pub fn edge(self, source: &str, target: &str) -> GraphAgentBuilder
Add a direct edge
Sourcepub fn conditional_edge<F, I>(
self,
source: &str,
router: F,
targets: I,
) -> GraphAgentBuilder
pub fn conditional_edge<F, I>( self, source: &str, router: F, targets: I, ) -> GraphAgentBuilder
Add a conditional edge
Sourcepub fn checkpointer<C>(self, checkpointer: C) -> GraphAgentBuilderwhere
C: Checkpointer + 'static,
pub fn checkpointer<C>(self, checkpointer: C) -> GraphAgentBuilderwhere
C: Checkpointer + 'static,
Set checkpointer
Sourcepub fn checkpointer_arc(
self,
checkpointer: Arc<dyn Checkpointer>,
) -> GraphAgentBuilder
pub fn checkpointer_arc( self, checkpointer: Arc<dyn Checkpointer>, ) -> GraphAgentBuilder
Set checkpointer with Arc
Sourcepub fn interrupt_before(self, nodes: &[&str]) -> GraphAgentBuilder
pub fn interrupt_before(self, nodes: &[&str]) -> GraphAgentBuilder
Set nodes to interrupt before
Sourcepub fn interrupt_after(self, nodes: &[&str]) -> GraphAgentBuilder
pub fn interrupt_after(self, nodes: &[&str]) -> GraphAgentBuilder
Set nodes to interrupt after
Sourcepub fn max_concurrency(self, limit: usize) -> GraphAgentBuilder
pub fn max_concurrency(self, limit: usize) -> GraphAgentBuilder
Cap how many nodes execute concurrently within one super-step.
Sourcepub fn recursion_limit(self, limit: usize) -> GraphAgentBuilder
pub fn recursion_limit(self, limit: usize) -> GraphAgentBuilder
Sets how many super-steps each turn may take; 100 when unset.
Sourcepub fn node_timeout(
self,
node_name: &str,
policy: TimeoutPolicy,
) -> GraphAgentBuilder
pub fn node_timeout( self, node_name: &str, policy: TimeoutPolicy, ) -> GraphAgentBuilder
Set a timeout policy for a specific node.
The policy is applied when the named node executes, enforcing wall-clock and/or idle timeouts with the configured recovery action.
§Example
use std::time::Duration;
use adk_graph::timeout::{TimeoutPolicy, OnTimeout};
let agent = GraphAgent::builder("my_graph")
.node_timeout("slow_node", TimeoutPolicy {
run_timeout: Some(Duration::from_secs(10)),
idle_timeout: None,
on_timeout: OnTimeout::Fail,
})
.build()?;Sourcepub fn default_timeout(self, policy: TimeoutPolicy) -> GraphAgentBuilder
pub fn default_timeout(self, policy: TimeoutPolicy) -> GraphAgentBuilder
Set a default timeout policy applied to all nodes without an explicit override.
Nodes that have a per-node policy set via node_timeout
will use their specific policy instead of this default.
§Example
use std::time::Duration;
use adk_graph::timeout::{TimeoutPolicy, OnTimeout};
let agent = GraphAgent::builder("my_graph")
.default_timeout(TimeoutPolicy {
run_timeout: Some(Duration::from_secs(30)),
idle_timeout: Some(Duration::from_secs(5)),
on_timeout: OnTimeout::Skip,
})
.build()?;Sourcepub fn mark_deferred(
self,
name: &str,
config: DeferredNodeConfig,
) -> GraphAgentBuilder
pub fn mark_deferred( self, name: &str, config: DeferredNodeConfig, ) -> GraphAgentBuilder
Add a deferred (fan-in barrier) node to the graph.
A deferred node waits for all upstream parallel paths to complete before
executing. The provided function is wrapped as a FunctionNode and the
DeferredNodeConfig controls how upstream outputs are merged and how
long the node waits for all paths.
§Arguments
name- The name of the deferred node.func- The async function to execute once all upstream paths complete.config- Configuration controlling merge strategy and fan-in timeout.
§Example
use std::time::Duration;
use adk_graph::deferred::{DeferredNodeConfig, MergeStrategy};
use adk_graph::node::NodeOutput;
let agent = GraphAgent::builder("scatter_gather")
.deferred_node("aggregator", |_ctx| async {
Ok(NodeOutput::new().with_update("status", serde_json::json!("merged")))
}, DeferredNodeConfig {
merge_strategy: MergeStrategy::Collect,
fan_in_timeout: Some(Duration::from_secs(30)),
})
.build()?;Configure fan-in for a node already added with node.
deferred_node both adds and configures a node, so
a custom Node added through node had no way to set a merge strategy or
a fan-in timeout.
A node reached by more than one unconditional edge is deferred automatically; this overrides that default.
pub fn deferred_node<F, Fut>(
self,
name: &str,
func: F,
config: DeferredNodeConfig,
) -> GraphAgentBuilderwhere
F: Fn(NodeContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<NodeOutput, GraphError>> + Send + 'static,
Sourcepub fn governed_node(
self,
name: &str,
governed: GovernedNode,
) -> GraphAgentBuilder
pub fn governed_node( self, name: &str, governed: GovernedNode, ) -> GraphAgentBuilder
Puts a node’s calls on the governed path (spec 3.3 §12).
See CompiledGraph::with_governed_node
and the governed module.
§Example
use adk_graph::agent::GraphAgent;
use adk_graph::edge::{END, START};
use adk_graph::governed::GovernedNode;
use adk_graph::node::NodeOutput;
let agent = GraphAgent::builder("invoice-run")
.channels(&["charge"])
.node_fn("pay", |_ctx| async { Ok(NodeOutput::new()) })
.edge(START, "pay")
.edge("pay", END)
.governed_node("pay", GovernedNode::new().with_approval().spending_money())
.build()?;
assert!(agent.graph().shape().nodes[0].governed.is_some());Sourcepub fn node_cache(
self,
name: &str,
policy: NodeCachePolicy,
) -> GraphAgentBuilder
Available on crate feature node-cache only.
pub fn node_cache( self, name: &str, policy: NodeCachePolicy, ) -> GraphAgentBuilder
node-cache only.Set a cache policy for a specific node.
When a node has a cache policy, its execution results are cached keyed by a blake3 hash of the node name and input state. Subsequent executions with identical inputs return the cached result without re-executing the node.
§Arguments
name— the name of the node to cachepolicy— the cache policy specifying backend and TTL
§Example
use std::time::Duration;
use adk_graph::cache::{CacheBackend, NodeCachePolicy};
let agent = GraphAgent::builder("cached_graph")
.node_cache("expensive_node", NodeCachePolicy {
backend: CacheBackend::InMemory { max_entries: 128 },
ttl: Some(Duration::from_secs(300)),
})
.build()?;Sourcepub fn input_mapper<F>(self, mapper: F) -> GraphAgentBuilder
pub fn input_mapper<F>(self, mapper: F) -> GraphAgentBuilder
Set custom input mapper
Sourcepub fn output_mapper<F>(self, mapper: F) -> GraphAgentBuilder
pub fn output_mapper<F>(self, mapper: F) -> GraphAgentBuilder
Set custom output mapper
Sourcepub fn resume_mapper<F>(self, mapper: F) -> GraphAgentBuilder
pub fn resume_mapper<F>(self, mapper: F) -> GraphAgentBuilder
Maps a turn to the answer a paused node reads with
NodeContext::resume_value.
Called on every turn; the answer reaches only a node that the turn resumes
from its own dynamic interrupt. Return None to resume without one. The
default answers with the turn’s text.
§Example
use adk_graph::agent::GraphAgent;
use serde_json::json;
let builder = GraphAgent::builder("refunds").resume_mapper(|ctx| {
let text: String = ctx.user_content().parts.iter().filter_map(|p| p.text()).collect();
Some(json!({ "approved": text.trim().eq_ignore_ascii_case("approve") }))
});Sourcepub fn before_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
pub fn before_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
Set before agent callback
Sourcepub fn after_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
pub fn after_agent_callback<F, Fut>(self, callback: F) -> GraphAgentBuilder
Set after agent callback
Note: The callback receives a cloned Event to avoid lifetime issues.
Sourcepub fn action_node(self, config: ActionNodeConfig) -> GraphAgentBuilder
Available on crate feature action only.
pub fn action_node(self, config: ActionNodeConfig) -> GraphAgentBuilder
action only.Add an action node to the graph.
Wraps the ActionNodeConfig in an ActionNodeExecutor and registers it
as a node. If the config is a SwitchNodeConfig, conditional edges are
also auto-registered from the switch conditions.
Sourcepub fn build(self) -> Result<GraphAgent, GraphError>
pub fn build(self) -> Result<GraphAgent, GraphError>
Build the GraphAgent
Auto Trait Implementations§
impl !RefUnwindSafe for GraphAgentBuilder
impl !UnwindSafe for GraphAgentBuilder
impl Forget for GraphAgentBuilder
impl Freeze for GraphAgentBuilderwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, Channel)>: Freeze,
PhantomData<Arc<dyn Node>>: Freeze,
PhantomData<Edge>: Freeze,
*const ArcInner<dyn Checkpointer> is !null: Freeze,
PhantomData<ArcInner<dyn Checkpointer>>: Freeze,
PhantomData<String>: Freeze,
*const ArcInner<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send>>: Freeze,
PhantomData<(String, TimeoutPolicy)>: Freeze,
PhantomData<(String, DeferredNodeConfig)>: Freeze,
PhantomData<(String, GovernedNode)>: Freeze,
PhantomData<(String, NodeCachePolicy)>: Freeze,
impl Move for GraphAgentBuilder
impl Send for GraphAgentBuilderwhere
RawVecInner: Send,
RawTable<(String, Channel)>: Send,
Arc<dyn Node>: Send,
Arc<dyn Fn(&HashMap<String, Value>) -> String + Sync + Send>: Send,
RawTable<(String, EdgeTarget)>: Send,
Arc<dyn Checkpointer>: Send,
Arc<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send>: Send,
Arc<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send>: Send,
Arc<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send>: Send,
RawTable<(String, TimeoutPolicy)>: Send,
RawTable<(String, DeferredNodeConfig)>: Send,
RawTable<(String, GovernedNode)>: Send,
RawTable<(String, NodeCachePolicy)>: Send,
impl Sync for GraphAgentBuilderwhere
RawVecInner: Sync,
RawTable<(String, Channel)>: Sync,
Arc<dyn Node>: Sync,
Arc<dyn Fn(&HashMap<String, Value>) -> String + Sync + Send>: Sync,
RawTable<(String, EdgeTarget)>: Sync,
Arc<dyn Checkpointer>: Sync,
Arc<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send>: Sync,
Arc<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send>: Sync,
Arc<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send>: Sync,
RawTable<(String, TimeoutPolicy)>: Sync,
RawTable<(String, DeferredNodeConfig)>: Sync,
RawTable<(String, GovernedNode)>: Sync,
RawTable<(String, NodeCachePolicy)>: Sync,
impl Unpin for GraphAgentBuilderwhere
*const u8 is !null: Unpin,
Arc<dyn Fn(Value, Value) -> Value + Sync + Send>: Unpin,
Arc<dyn Node>: Unpin,
Arc<dyn Fn(&HashMap<String, Value>) -> String + Sync + Send>: Unpin,
Arc<dyn Checkpointer>: Unpin,
Arc<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send>: Unpin,
Arc<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send>: Unpin,
Arc<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send>: Unpin,
Arc<dyn Fn(Vec<Value>) -> Value + Sync + Send>: Unpin,
impl UnsafeUnpin for GraphAgentBuilderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, Channel)>: UnsafeUnpin,
PhantomData<Arc<dyn Node>>: UnsafeUnpin,
PhantomData<Edge>: UnsafeUnpin,
*const ArcInner<dyn Checkpointer> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Checkpointer>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&dyn InvocationContext) -> HashMap<String, Value> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&HashMap<String, Value>) -> Vec<Event> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Arc<dyn InvocationContext>) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Arc<dyn InvocationContext>, Event) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&dyn InvocationContext) -> Option<Value> + Sync + Send>>: UnsafeUnpin,
PhantomData<(String, TimeoutPolicy)>: UnsafeUnpin,
PhantomData<(String, DeferredNodeConfig)>: UnsafeUnpin,
PhantomData<(String, GovernedNode)>: UnsafeUnpin,
PhantomData<(String, NodeCachePolicy)>: UnsafeUnpin,
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> 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,
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.