pub struct RigAgentLoop {
pub media_staging: AgentMediaStaging,
/* private fields */
}Expand description
Rig-based agentic execution loop
Uses rig-core’s AgentBuilder for multi-turn execution with MCP tools.
§Chat History
The agent loop now supports conversation history for multi-turn interactions:
let mut agent = RigAgentLoop::new(...)?;
// First turn
let result = agent.run_claude().await?;
// Continue conversation with history
agent.add_to_history("What's the capital of France?", &result.final_output.to_string());
let result2 = agent.chat_continue("And what about Germany?").await?;Fields§
§media_staging: AgentMediaStagingShared media staging for agent tool calls (H1 side-channel). Binary content blocks from MCP tools are collected here since rig’s ToolDyn::call() returns String only.
Implementations§
Source§impl RigAgentLoop
impl RigAgentLoop
Sourcepub fn add_to_history(&mut self, user_prompt: &str, assistant_response: &str)
pub fn add_to_history(&mut self, user_prompt: &str, assistant_response: &str)
Add a user/assistant turn to the conversation history
Call this after each completed turn to maintain context for chat_continue().
Sourcepub fn push_message(&mut self, message: Message)
pub fn push_message(&mut self, message: Message)
Add a single message to the history
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear all conversation history and reset turn count
Sourcepub fn history_len(&self) -> usize
pub fn history_len(&self) -> usize
Get the current history length (number of messages)
Sourcepub fn turn_count(&self) -> u32
pub fn turn_count(&self) -> u32
Get the number of completed turns (user + assistant exchanges).
Sourcepub fn with_history(self, history: Vec<Message>) -> Self
pub fn with_history(self, history: Vec<Message>) -> Self
Create with pre-existing history
Useful for resuming conversations or injecting context.
Sourcepub async fn chat_continue(
&mut self,
prompt: &str,
) -> Result<RigAgentLoopResult, NikaError>
pub async fn chat_continue( &mut self, prompt: &str, ) -> Result<RigAgentLoopResult, NikaError>
Continue a conversation using the accumulated history
Uses rig-core’s Chat trait for multi-turn conversations.
The history is automatically updated with the user prompt and response.
§Example
// First turn
let result1 = agent.run_claude().await?;
agent.add_to_history("Initial prompt", &extract_text(&result1));
// Continue conversation
let result2 = agent.chat_continue("Follow-up question").await?;
// History now contains both turnsSource§impl RigAgentLoop
impl RigAgentLoop
Sourcepub async fn run_mock(&self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_mock(&self) -> Result<RigAgentLoopResult, NikaError>
Run the agent loop with a mock provider (for testing)
This method simulates agent execution without making real API calls.
Sourcepub async fn run_claude(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_claude(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run the agent loop with the real Claude provider
This method uses rig-core’s AgentBuilder for actual execution. Requires ANTHROPIC_API_KEY environment variable to be set.
Includes confidence retry loop and guardrail retry loop, matching the generic provider path behavior.
§Note
This method takes &mut self because tools are consumed (moved to rig’s AgentBuilder).
The agent loop is designed for single-use execution.
§Extended Thinking
When extended_thinking: true is set in AgentParams, this method uses
the streaming API to capture Claude’s reasoning process. The thinking
is stored in AgentTurnMetadata.thinking for observability.
§Token Tracking
- Without tools: Uses streaming API for accurate token tracking
- With tools: Falls back to agent.prompt() (tokens will be 0)
- With extended_thinking: Uses dedicated streaming path
Sourcepub async fn run_openai(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_openai(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run the agent loop with the OpenAI provider
This method uses rig-core’s OpenAI client for actual execution. Requires OPENAI_API_KEY environment variable to be set.
Includes confidence retry loop and guardrail retry loop, matching the generic provider path behavior.
§Note
This method takes &mut self because tools are consumed (moved to rig’s AgentBuilder).
The agent loop is designed for single-use execution.
Sourcepub async fn run_auto(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_auto(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run the agent loop with the best available provider
Provider selection order:
- Check AgentParams.provider field
- Check ANTHROPIC_API_KEY env var → use Claude
- Check OPENAI_API_KEY env var → use OpenAI
- Check MISTRAL_API_KEY env var → use Mistral
- Check GROQ_API_KEY env var → use Groq
- Check DEEPSEEK_API_KEY env var → use DeepSeek
- Error if no provider available
§Note
This is the recommended method for production use.
Sourcepub async fn run_mistral(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_mistral(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run with Mistral provider (requires MISTRAL_API_KEY)
Sourcepub async fn run_groq(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_groq(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run with Groq provider (requires GROQ_API_KEY)
Sourcepub async fn run_deepseek(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_deepseek(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run with DeepSeek provider (requires DEEPSEEK_API_KEY)
Sourcepub async fn run_gemini(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_gemini(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run with Gemini provider (requires GEMINI_API_KEY)
Sourcepub async fn run_xai(&mut self) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_xai(&mut self) -> Result<RigAgentLoopResult, NikaError>
Run with xAI provider (requires XAI_API_KEY)
Source§impl RigAgentLoop
impl RigAgentLoop
Sourcepub fn check_guardrails(&self, output: &str) -> GuardrailCheckResult
pub fn check_guardrails(&self, output: &str) -> GuardrailCheckResult
Run all configured guardrails against the output
Emits events for each guardrail result:
GuardrailPassed: Guardrail check succeededGuardrailFailed: Guardrail check failedGuardrailEscalation: Guardrail failed withon_failure: escalate
Returns GuardrailCheckResult indicating the appropriate action:
AllPassed: All guardrails passedFailedRetry: Some failed withon_failure: retry(default)FailedEscalate: Some failed withon_failure: escalateFailedImmediate: Some failed withon_failure: fail
Priority: Immediate > Escalate > Retry
Sourcepub fn determine_status(&self, output: &str) -> RigAgentStatus
pub fn determine_status(&self, output: &str) -> RigAgentStatus
Determine agent status based on output content
Checks in order:
- Explicit completion via nika:complete tool
- With confidence: compare against threshold → HighConfidence/LowConfidence
- Without confidence: ExplicitCompletion
- Pattern completion (if
completion.mode: pattern) - Natural completion — but only when mode is NOT
explicitWhencompletion.mode: explicit, natural end-of-turn withoutnika:completereturnsLowConfidence(0.0)to trigger retry.
Sourcepub async fn run_claude_with_thinking(
&mut self,
) -> Result<RigAgentLoopResult, NikaError>
pub async fn run_claude_with_thinking( &mut self, ) -> Result<RigAgentLoopResult, NikaError>
Run the agent loop with extended thinking enabled (Claude only).
Uses rig-core’s streaming API to capture thinking blocks from Claude’s extended thinking feature. The thinking is accumulated and stored in the AgentTurnMetadata for observability.
§Errors
- NIKA-113: Extended thinking failed
- NIKA-110: Agent execution error
Source§impl RigAgentLoop
impl RigAgentLoop
Sourcepub fn new(
task_id: String,
params: AgentParams,
event_log: EventLog,
mcp_clients: FxHashMap<String, Arc<McpClient>>,
) -> Result<Self, NikaError>
pub fn new( task_id: String, params: AgentParams, event_log: EventLog, mcp_clients: FxHashMap<String, Arc<McpClient>>, ) -> Result<Self, NikaError>
Create a new rig-based agent loop
§Errors
- NIKA-113: Empty prompt
- NIKA-113: Invalid max_turns (0 or > 100)
Sourcepub fn with_stream_tx(self, tx: Sender<StreamChunk>) -> Self
pub fn with_stream_tx(self, tx: Sender<StreamChunk>) -> Self
Set streaming channel for real-time token display
When set, tokens will be sent to this channel as they arrive during streaming. This enables Claude Code-like real-time text display in the TUI.
Sourcepub fn with_skills(
self,
injector: Arc<SkillInjector>,
skills_map: HashMap<String, String>,
base_dir: PathBuf,
) -> Self
pub fn with_skills( self, injector: Arc<SkillInjector>, skills_map: HashMap<String, String>, base_dir: PathBuf, ) -> Self
Configure skill injection for this agent
When set, skills defined in the workflow are loaded and prepended to the agent’s system prompt before LLM calls.
§Arguments
injector- Shared SkillInjector instance (with DashMap cache)skills_map- Mapping of skill names to file paths from workflow YAMLbase_dir- Base directory for resolving relative skill paths
§Example
let agent = RigAgentLoop::new(task_id, params, log, mcp)?
.with_skills(
Arc::new(SkillInjector::new()),
skills_map,
PathBuf::from("/path/to/workflow"),
);Sourcepub fn with_structured_output(self, schema: Value) -> Self
pub fn with_structured_output(self, schema: Value) -> Self
Inject a DynamicSubmitTool for structured output enforcement.
When the task has an output policy with a JSON schema, this adds
submit_result as an available tool. Unlike infer: (which forces
tool_choice: Required), the agent can call submit_result when
ready — it’s available but not forced.
§Arguments
schema- JSON Schema asserde_json::Valuefor the expected output
Sourcepub fn drain_media(&self) -> Vec<ContentBlock>
pub fn drain_media(&self) -> Vec<ContentBlock>
Drain collected media content blocks from all agent tool calls.
Returns all ContentBlocks that were staged during the agent loop. The DashMap is drained (emptied) after this call.
Sourcepub fn tool_count(&self) -> usize
pub fn tool_count(&self) -> usize
Get the number of tools available
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RigAgentLoop
impl !RefUnwindSafe for RigAgentLoop
impl Send for RigAgentLoop
impl Sync for RigAgentLoop
impl Unpin for RigAgentLoop
impl UnsafeUnpin for RigAgentLoop
impl !UnwindSafe for RigAgentLoop
Blanket Implementations§
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
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> 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> 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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
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,
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.