Skip to main content

Kernel

Struct Kernel 

Source
pub struct Kernel { /* private fields */ }
Expand description

The resident supervisor (spec 3.2 §7.2). Cloning shares the kernel.

§Example

use std::sync::Arc;
use adk_core::InMemoryRunStore;
use adk_kernel::{Kernel, KernelConfig};

let kernel = Kernel::builder()
    .config(KernelConfig::default())
    .run_store(Arc::new(InMemoryRunStore::new()))
    .agent("adk-rust", runner)
    .build()?;
kernel.start().await?;
kernel.shutdown_on_signal().await?;

Implementations§

Source§

impl Kernel

Source

pub async fn area_settings(&self, partition: &PartitionId) -> Result<AreaView>

The settings in force in partition (spec 3.3 §10 K3), as GET /kernel/settings/{partition} answers them: quiet time, the daily spending limit with what was spent today, the mode, and whether the primary agent works there.

§Example
use adk_kernel::{Kernel, PartitionId};

let area = kernel.area_settings(&PartitionId::default()).await?;
let left = area.daily_spending_limit.map(|limit| limit.saturating_sub(area.spent_today));
§Errors

Returns a store error when the partition table, the control store or the spend totals cannot be read.

Source§

impl Kernel

Source

pub const SIGTERM_DRAIN: Duration

How long shutdown_on_signal drains before it stops.

Source

pub fn builder() -> KernelBuilder

A builder.

Source

pub fn config(&self) -> &KernelConfig

The configuration the kernel was built with.

Source

pub fn store_uses(&self) -> &[StoreUse]

Each stateful store of the kernel: where it came from and whether it is known to be held in memory (spec 3.2 §7.1, KernelBuilder::require_durable).

Source

pub fn inventory(&self) -> KernelInventory

What the kernel runs, and a warning for each thing it would silently not do (KernelInventory): logged when the kernel starts and served at GET /api/kernel/inventory.

Source

pub fn signal_sink( &self, partition: impl Into<PartitionId>, ) -> Result<SignalSink>

The sink that files signals in partition (spec 3.5 §7.10; feature charter): on the kernel’s agenda store, wake router, event bus, clock and audit trail, through the store KernelBuilder::signals registered for the partition. Each filed or counted signal wakes the Wake::Signal sleepers and triggers of the partition.

§Errors

Returns KernelError::Config when no signal store is registered for partition.

Source

pub async fn start(&self) -> Result<()>

Starts the workers, scheduler, wake sources and control plane, after reconciling the wakes missed while the kernel was down. Records kernel.started.

A mirrored kill switch is read before anything else, for at most KernelConfig::GOVERNANCE_FIRST_READ, so work spawned once start returns is decided by the store’s state rather than refused as never read. A store that cannot be read in that time leaves the control stale: the kernel starts and refuses work until its mirror reads the store.

Processes a drain parked are woken first, and those a freeze parked when the control allows work again.

§Errors

Returns KernelError::Lifecycle when the kernel already runs, KernelError::ControlPlane when the socket or bind is taken, or a store error.

Source

pub async fn pause(&self) -> Result<()>

Stops claiming; running processes run their attempt to its end. Records kernel.paused.

§Errors

Returns KernelError::Lifecycle when the kernel is not running.

Source

pub async fn resume(&self) -> Result<()>

Claims again after pause or drain, waking the processes a drain parked. Records kernel.resumed.

§Errors

Returns KernelError::Lifecycle when the kernel is not paused.

Source

pub async fn drain(&self, timeout: Duration) -> Result<()>

Suspends running processes at their next checkpoint through S1’s suspend path (Suspension::Drain), then stops claiming; on timeout aborts the claim loops so their leases lapse. Records kernel.drained. The kernel is paused afterwards: resume or a later start wakes what the drain parked.

§Errors

Returns KernelError::Lifecycle when the kernel is not running or paused, or a store error.

Source

pub async fn stop(&self) -> Result<()>

Drains for SIGTERM_DRAIN, unless a drain already paused the kernel, stops drivers and closes the control plane. Records kernel.stopped.

§Errors

Returns a store or control-plane error; the kernel is stopped regardless.

Source

pub async fn shutdown_on_signal(&self) -> Result<()>

Waits for SIGTERM or Ctrl-C — or, in a Windows service, the service manager’s stop (spec 3.2 §10 W3) — then stops, which drains once for SIGTERM_DRAIN.

§Errors

Returns the error of stop, or KernelError::Io when the signal handler cannot be installed.

Source

pub async fn freeze(&self, reason: &str, by: AuditActor) -> Result<()>

Freezes execution as by: GovernanceControl::freeze_recorded, then the running processes park Waiting at their next checkpoint with Suspension::Freeze, one kernel.process.suspended record each, on every replica within one second (K-I8). No process starts until unfreeze.

§Errors

Returns the control’s error when the freeze cannot be recorded; this replica is frozen regardless.

Source

pub async fn unfreeze(&self, by: AuditActor) -> Result<()>

Lifts the freeze as by: GovernanceControl::unfreeze_recorded, then wakes exactly the processes the freeze parked, never a manual or preempted suspension (K-I21).

§Errors

Returns the control’s error when the unfreeze cannot be recorded; execution stays frozen.

Source

pub async fn run_now( &self, target: RunNowTarget, request_id: Option<&str>, by: AuditActor, ) -> Result<RunNow>

Runs a cron sleeper or a standing cron trigger now, outside its schedule, for by.

The run now is a wake like a tick’s: an event keyed keys::run_now that becomes its kernel.wake run, so a retried request with the same request_id routes once, and the router wakes the sleeper, or fires the trigger, as a tick would. The woken run passes admission like any other: quiet hours defer it, a spent budget parks it, a quota holds it. The schedule is untouched: no watermark moves, the next tick fires as planned, and a recurring sleeper’s successor sleeps on the same cron wake after the run. The turn is told it was run now: its wake reason’s payload carries run_now, the expression and who asked. The call is recorded as kernel.run_now.

A run now of a trigger follows the trigger’s WakeOverlap as a tick does: while a process the trigger started is unfinished, skip refuses it here, queueOne queues one behind it or joins the one already waiting, and queue queues behind it.

TargetMust be
RunNowTarget::ProcessWaiting, not suspended, its wake set holding a cron wake
RunNowTarget::TriggerA standing trigger of this kernel on a cron wake
§Example
use adk_core::audit_log::AuditActor;
use adk_kernel::{Kernel, RunNowTarget};

let run_now = kernel
    .run_now(RunNowTarget::Trigger { name: "nightly-digest".into() }, None, AuditActor::default())
    .await?;
println!("queued {}", run_now.key);
§Errors

Returns KernelError::Frozen while the kill switch refuses work, so nothing is queued; KernelError::NotFound or KernelError::InvalidState for a process that is missing or not asleep on a cron wake; KernelError::Config for a name no cron trigger has; KernelError::InvalidState, naming the unfinished process, for a trigger whose overlap is skip; or a store error.

Source

pub async fn steer( &self, user_id: &str, session_id: &str, text: &str, ) -> Result<Option<Steering>>

Sends text to the turn of user_id’s session session_id that this replica runs (spec 3.3 §6 “steer”): Runner::steer on the runner of the process’s target, so the message is screened as a turn’s own message is and the agent takes it at its next safe point.

Returns None when no turn of the session takes messages here: none runs, another replica runs it, its target is a workflow, or its run has not reached its agent yet. Send the message as the session’s next message then. An added agent’s turn that started before the agent was changed finishes on the build it started on, which is no longer hosted, so it answers None too.

§Errors

Returns KernelError::Frozen while everything is stopped, or the runner’s error when text is blank or an input guardrail or plugin refuses the message.

§Example
use adk_core::SteerOutcome;

match kernel.steer("ana", "s-1", "use the staging database").await? {
    Some(steering) => match steering.receipt.outcome().await? {
        SteerOutcome::Delivered { event_id } => println!("delivered as {event_id}"),
        SteerOutcome::Returned(_) => println!("send it as the next message"),
    },
    None => println!("no turn runs here: send it as the next message"),
}
Source

pub fn processes(&self) -> &ProcessTable

The process table.

Source

pub fn subagents(&self) -> Option<&DurableSubagents>

The background sub-agent host, when the kernel was built with KernelBuilder::subagents.

Source

pub fn agenda(&self) -> &Agenda

The agenda (spec 3.2 §7.5).

Source

pub fn partitions(&self) -> &Partitions

The partition table and its crossings (spec 3.2 §7.8).

Source

pub fn partition_of_target(&self, target: &str) -> Option<&PartitionId>

The partition the target target is bound to, when it is a partition agent’s.

Source

pub fn agents(&self) -> &Agents

The agents a person adds, by asking or by hand (spec 3.3 §5.7, §10 K7): every change to one goes through this table.

Source

pub fn bus(&self) -> &EventBus

The event bus.

Source

pub fn wake_router(&self) -> &WakeRouter

The wake matcher.

Source

pub async fn control_addr(&self) -> Option<SocketAddr>

The address the control plane’s HTTP listener is bound to while the kernel runs, so a bind on port 0 is discoverable (spec 3.2 §7.11, spec 3.5 §8.2); None when the control plane serves no HTTP or the kernel is not running.

§Example
ⓘ
let control = ControlPlaneConfig::default().without_socket().with_http("127.0.0.1:0".parse()?);
kernel.start().await?;
let addr = kernel.control_addr().await.expect("the control plane listens");
Source

pub fn ledger(&self) -> Option<&Ledger>

The content-free activity ledger the kernel writes, when it was built with one (spec 3.2 §7.10, feature proc).

Source

pub fn serves_routes(&self) -> bool

Whether control::router built this kernel’s control-plane routes for a server, so a page served beside them may read them: the web home reads /api/kernel only then (spec 3.3 §10).

§Example
assert!(!kernel.serves_routes());
let _routes = adk_kernel::control::router(kernel.clone());
assert!(kernel.serves_routes());
Source

pub async fn quiet_until( &self, partition: &PartitionId, at: DateTime<Utc>, ) -> Option<DateTime<Utc>>

The end of the quiet time that holds at in partition, followed through windows that touch; None when at is not quiet (spec 3.3 §5.4, §10 K3). It reads the windows in force now: the kernel’s, the proactivity policy’s and the partition’s own, with a quiet time the person changed while the kernel runs in place of the kernel’s and the partition’s. A phone’s wake-up waits for it.

§Example
use adk_kernel::PartitionId;

if let Some(until) = kernel.quiet_until(&PartitionId::default(), chrono::Utc::now()).await {
    println!("quiet until {until}");
}
Source

pub fn events(&self) -> EventSubscriber

Subscribes to the event bus from now on.

Source

pub fn health(&self) -> KernelHealth

The kernel’s health: per worker, scheduler lag, store latency.

Source§

impl Kernel

Source

pub fn drivers(&self) -> Option<&DriverSupervisor>

The driver supervisor, when the kernel was built with one (spec 3.2 §7.7).

Trait Implementations§

Source§

impl ChannelHost for Kernel

Source§

fn quiet_until(&self, at: DateTime<Utc>) -> Option<DateTime<Utc>>

The end of the kernel’s quiet hours and its proactivity policy’s, whichever hold at, followed through windows that touch: the windows the kernel started with.

Source§

fn quiet_ends<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ApprovalRequest, at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Option<DateTime<Utc>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The end of the quiet time in force in the decision’s area that holds at: the person’s window changed while the kernel runs in place of the start ones, beside the workspace’s (spec 3.3 §10 K3). The area is the partition of the process that holds the call, else default.

Source§

fn moves_money(&self, request: &ApprovalRequest) -> bool

Whether a mounted driver declares the called tool financial (spec 3.2 K-I9); a name two drivers share counts when either declares it so.

Source§

fn rates_high(&self, request: &ApprovalRequest) -> bool

Whether a mounted driver declares the called tool of a class nothing may allow without a person (spec 3.2 K-I9).

Source§

fn steer<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, user: &'life1 str, session: &'life2 str, text: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SteerReceipt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Kernel::steer: the turn this replica runs takes the message.

Source§

fn finished_turns<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, RunRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The bus’s finished processes whose runs a channel started, read from the run store.

Source§

fn app_name(&self) -> &str

The application the turns run in.
Source§

fn now(&self) -> DateTime<Utc>

The time now.
Source§

fn approvals(&self) -> Option<Arc<dyn ApprovalService>>

The approval service decisions go through; None when the host has none.
Source§

fn audit_trail(&self) -> Option<AuditTrail>

The audit trail the kernel.channel records go to.
Source§

fn turn<'life0, 'life1, 'async_trait>( &'life0 self, pid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The run of turn pid as it stands, wherever it runs: the gateway asks after the turns it started, so a turn another replica ran still gets its reply. None by default, for a host whose turns all finish in finished_turns. Read more
Source§

fn start_turn<'life0, 'async_trait>( &'life0 self, run: NewRun, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts run, a paired account’s turn; a run whose idempotency key was used returns the process that key started. Returns the process id. Read more
Source§

fn stop_all<'life0, 'life1, 'async_trait>( &'life0 self, reason: &'life1 str, by: AuditActor, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stops everything, as by. Read more
Source§

impl Clone for Kernel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Kernel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FreezeDelegate for Kernel

Source§

fn freeze<'life0, 'life1, 'async_trait>( &'life0 self, reason: &'life1 str, by: AuditActor, ) -> Pin<Box<dyn Future<Output = Result<FreezeReport>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Freezes execution for reason as by, stops the running runs, and reports what happened to them. Read more
Source§

fn unfreeze<'life0, 'async_trait>( &'life0 self, by: AuditActor, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lifts the freeze as by and resumes what the freeze stopped. Read more
Source§

fn running_runs(&self) -> RunningRuns

What a freeze does with running runs, reported as runningRuns. A delegate parks.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Kernel

§

impl !UnwindSafe for Kernel

§

impl Forget for Kernel

§

impl Freeze for Kernel
where *const ArcInner<KernelInner> is !null: Freeze, PhantomData<ArcInner<KernelInner>>: Freeze,

§

impl Move for Kernel

§

impl Send for Kernel
where Arc<KernelInner>: Send,

§

impl Sync for Kernel
where Arc<KernelInner>: Sync,

§

impl Unpin for Kernel
where Arc<KernelInner>: Unpin,

§

impl UnsafeUnpin for Kernel
where *const ArcInner<KernelInner> is !null: UnsafeUnpin, PhantomData<ArcInner<KernelInner>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more