Skip to main content

ControlClient

Struct ControlClient 

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

A client of a running kernel’s control plane (spec 3.2 §7.11), over its Unix socket, its named pipe on Windows (§10 W2) or HTTP. Surfaces hold no state (K-I17): every call reads the kernel.

§Example

use adk_kernel::control::ControlClient;

let client = match ControlClient::connect_local(home).await? {
    Some(client) => client,
    None => ControlClient::http("https://kernel.example.com").with_bearer_token("token"),
};
for process in client.processes(&Default::default()).await? {
    println!("{} {:?}", process.meta.pid, process.run.state);
}

Implementations§

Source§

impl ControlClient

Source

pub fn socket(path: impl Into<PathBuf>) -> Self

A client of the kernel listening on the Unix socket at path.

Source

pub fn http(base_url: impl Into<String>) -> Self

A client of the kernel serving HTTP at base_url, the routes under its /api.

Source

pub fn with_bearer_token(self, token: impl Into<String>) -> Self

Sends token as a bearer token.

Source

pub fn bearer_token(&self) -> Option<&str>

The bearer token the client sends, so a caller of other routes on the same control plane (the approvals inbox, spec 3.3 §6) sends the same one.

§Example
use adk_kernel::control::ControlClient;

let client = ControlClient::http("https://kernel.example.com").with_bearer_token("token");
assert_eq!(client.bearer_token(), Some("token"));
assert_eq!(ControlClient::socket("/run/kernel.sock").bearer_token(), None);
Source

pub fn endpoint(&self) -> String

Where the client connects: unix:<path>, pipe:<name> or the base URL.

Source

pub async fn connect_local(home: &Path) -> Result<Option<Self>>

A client of the kernel running at home, or None when none answers on its socket, or on Windows its named pipe (spec 3.2 §10 W2).

A socket left by a kernel that did not stop cleanly counts as none; a pipe goes away with its kernel.

§Errors

Returns KernelError::ControlPlane when the socket or pipe exists but this user may not use it: another account owns it, or its permissions refuse this user; or when the directory of its own that a socket too long for the home sits in is a symlink, another user’s, or open to other users (spec 3.3 G18).

Source

pub async fn health(&self) -> Result<KernelHealth>

GET /kernel/health.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn inventory(&self) -> Result<KernelInventory>

GET /kernel/inventory: what the kernel runs, and a warning for each thing it would silently not do (Kernel::inventory); for the operator scope.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the kernel’s error for a caller without the operator scope.

Source

pub async fn partitions(&self) -> Result<Vec<Partition>>

GET /kernel/partitions: the partition table (spec 3.2 §7.8).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn agents(&self) -> Result<Vec<AgentView>>

GET /kernel/agents: the agents a person added, but tombstones and refused suggestions (spec 3.3 §10 K7).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn agent(&self, id: &str) -> Result<AgentView>

GET /kernel/agents/{id}: one agent a person added, tombstones included (spec 3.3 §10 K7).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: kernel.agent.not_found for an unknown id.

Source

pub async fn put_partition(&self, partition: &Partition) -> Result<Partition>

POST /kernel/partitions: creates or replaces partition (spec 3.2 §7.8).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn set_partition_mode( &self, id: &str, mode: PartitionMode, ) -> Result<Partition>

POST /kernel/partitions/{id}/mode: sets partition id’s mode (spec 3.2 §8.1).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn settings(&self) -> Result<Vec<AreaView>>

GET /kernel/settings: every area’s quiet time, daily spending limit and mode in force (spec 3.3 §10 K3).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 without the operator scope or a device’s read.

Source

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

GET /kernel/settings/{partition}: one area’s settings in force (spec 3.3 §10 K3).

§Errors

As settings, and 404 for an unknown area.

Source

pub async fn set_quiet_time( &self, partition: &str, window: Option<QuietHours>, ) -> Result<AreaView>

POST /kernel/settings/{partition}/quiet-time: sets the area’s quiet time, or turns it off with None (spec 3.3 §10 K3).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token or without the operator scope, 404 for an unknown area.

Source

pub async fn set_spending_limit( &self, partition: &str, micro_usd: Option<u64>, ) -> Result<AreaView>

POST /kernel/settings/{partition}/spending-limit: sets the area’s daily spending limit in micro-USD, or removes it with None (spec 3.3 §10 K3).

§Errors

As set_quiet_time.

Source

pub async fn set_area_mode( &self, partition: &str, mode: PartitionMode, ) -> Result<AreaView>

POST /kernel/settings/{partition}/mode: sets how much the area’s agents act alone (spec 3.3 §10 K3).

§Errors

As set_quiet_time.

Source

pub async fn away(&self, query: &AwayQuery) -> Result<AwayResponse>

GET /kernel/away: “While you were away” after the viewer’s cursor (spec 3.3 §10 K4). A paired device reads as itself; query.viewer names any other surface.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn mark_away_seen( &self, viewer: Option<&str>, through: u64, ) -> Result<AwayCursor>

POST /kernel/away/seen: marks “While you were away” seen through row through, a page’s through (spec 3.3 §10 K4); returns the cursor, which never moves back.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 400 for a row the ledger does not hold yet.

Source

pub async fn away_line(&self, seq: u64) -> Result<AwayLineResponse>

GET /kernel/away/lines/{seq}: one line of “While you were away” with its ledger row, the line’s record (spec 3.3 §10 K4).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 for a row the ledger does not hold.

Source

pub async fn memory(&self, area: Option<&str>) -> Result<MemoryResponse>

GET /kernel/memory: what the agents remember about the caller, with provenance, and the overnight tidy-ups (spec 3.3 §10 K5).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 400 when the kernel shows no memory.

Source

pub async fn confirm_fact(&self, id: &str) -> Result<RememberedFact>

POST /kernel/memory/facts/{id}/confirm: “That’s right” (spec 3.3 §8.2, §10 K5).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 404 for a fact that is not the caller’s.

Source

pub async fn fix_fact(&self, id: &str, text: &str) -> Result<RememberedFact>

POST /kernel/memory/facts/{id}/fix: “Fix it” with the person’s text (spec 3.3 §8.2, §10 K5).

§Errors

As confirm_fact, and 400 for a text the harness refuses.

Source

pub async fn forget_fact(&self, id: &str) -> Result<()>

POST /kernel/memory/facts/{id}/forget: “Forget it” (spec 3.3 §8.2, §10 K5).

§Errors

As confirm_fact.

Source

pub async fn undo_tidy_up(&self, id: Option<&str>) -> Result<TidyUpUndo>

POST /kernel/memory/undo: “Undo” the tidy-up id, or the latest one that can be undone (spec 3.3 §8.2, §10 K5).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 404 when nothing is left to undo, 409 for a tidy-up unfinished or undone.

Source

pub async fn record(&self, limit: Option<usize>) -> Result<Vec<RecordLine>>

GET /kernel/record: the latest limit actions on record, newest first (spec 3.3 §10 K5).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 400 when the kernel shows no record.

Source

pub async fn check_record(&self) -> Result<RecordCheck>

GET /kernel/record/check: whether every action is on record and nothing was changed or deleted, as adk-rust audit verify answers (spec 3.3 §10 K5).

§Errors

As record.

Source

pub async fn processes(&self, query: &ProcessesQuery) -> Result<Vec<Process>>

GET /kernel/processes.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn spawn(&self, request: &SpawnRequest) -> Result<Process>

POST /kernel/processes: starts a process of a registered target as the caller.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 for an unknown target, 403 without the operator scope.

Source

pub async fn approvals(&self) -> Result<Vec<ApprovalItem>>

GET /approvals: the held calls the caller may decide, pending first page.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 when it serves no approvals inbox.

Source

pub async fn decide( &self, id: &str, version: u64, action: ApprovalAction, reason: Option<&str>, ) -> Result<ApprovalItem>

POST /approvals/{id}/decide: decides a held call, at the version the caller read.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 409 for a stale version, 403 for a caller who may not decide it.

Source

pub async fn kill(&self, pid: &str, reason: Option<&str>) -> Result<Process>

POST /kernel/processes/{pid}/kill.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn nice(&self, pid: &str, queue: QueueClass) -> Result<Process>

POST /kernel/processes/{pid}/nice.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn suspend(&self, pid: &str) -> Result<Process>

POST /kernel/processes/{pid}/suspend.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn resume(&self, pid: &str) -> Result<Process>

POST /kernel/processes/{pid}/resume.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn run_now( &self, pid: &str, request_id: Option<&str>, ) -> Result<RunNow>

POST /kernel/processes/{pid}/run-now: runs a cron sleeper now, outside its schedule (Kernel::run_now); a retry with the same request_id queues nothing new.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered, such as kernel.frozen.

Source

pub async fn run_trigger_now( &self, name: &str, request_id: Option<&str>, ) -> Result<RunNow>

POST /kernel/triggers/{name}/run-now: runs a standing cron trigger now, outside its schedule (Kernel::run_now).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn drivers(&self) -> Result<Vec<DriverView>>

GET /kernel/drivers: the mounted drivers (spec 3.2 §7.7).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn mount_driver( &self, id: &str, manifest: &str, confirm: bool, ) -> Result<MountDriverResponse>

POST /kernel/drivers/{id}/mount: what mounting manifest (its TOML) approves, and with confirm the mount itself.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn unmount_driver(&self, id: &str) -> Result<bool>

POST /kernel/drivers/{id}/unmount; false when no such driver was mounted.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn restart_driver(&self, id: &str) -> Result<DriverView>

POST /kernel/drivers/{id}/restart.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn reapprove_driver(&self, id: &str) -> Result<DriverView>

POST /kernel/drivers/{id}/reapprove.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

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

POST /kernel/freeze.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn unfreeze(&self) -> Result<FreezeResponse>

POST /kernel/unfreeze.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn ledger(&self, params: &LedgerParams) -> Result<LedgerResponse>

GET /kernel/proc/ledger as JSON: one page of the activity ledger (spec 3.2 §7.10). Page on with params.after set to the answer’s next.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 without the operator scope.

Source

pub async fn baselines(&self) -> Result<Vec<PassState>>

GET /kernel/proc/baselines: each partition’s last baseline pass (spec 3.2 §7.10).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn observations( &self, params: &ObservationsParams, ) -> Result<Vec<Observation>>

GET /kernel/proc/observations: the observations the kernel offered, newest first (spec 3.2 §7.10).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn events( &self, after: Option<u64>, ) -> Result<BoxStream<'static, Result<EventRecord>>>

GET /kernel/events: the event bus from just after after, then live.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached; a broken stream ends with the error as its last item.

Source

pub async fn attach( &self, session_id: &str, request: &AttachRequest, ) -> Result<AttachResponse>

POST /kernel/attach/{session}.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

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

POST /kernel/sessions/{session}/steer: sends text to the running turn of the caller’s session session_id (spec 3.3 §6 “steer”).

SteerResponse::Accepted means the turn holds the message, not that it took it: the message is delivered once attach shows an event whose steering marker carries the answer’s steer id, and handed back once the process leaves the answer’s claim without one. On SteerResponse::Returned, spawn it as the session’s next message.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 without the operator scope or for a device token, 503 while everything is stopped, 400 for a blank message, or an input guardrail’s refusal.

§Example
use adk_kernel::control::ControlClient;
use adk_kernel::control::api::{SpawnRequest, SteerResponse};

let text = "use the staging database";
if client.steer("s-1", text).await? == SteerResponse::Returned {
    let next = SpawnRequest::new("adk-rust", serde_json::json!({ "text": text }));
    client.spawn(&next.with_session_id("s-1")).await?;
}
Source

pub async fn agenda(&self, query: &AgendaQuery) -> Result<Vec<AgendaItem>>

GET /kernel/agenda (spec 3.2 §7.5, §8.1 adk-rust agenda list).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn approve_item(&self, id: &str) -> Result<AgendaItem>

POST /kernel/agenda/{id}/approve: approves the item as the caller, then schedules it.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 for an unknown item, 409 for one not proposed.

Source

pub async fn reject_item( &self, id: &str, reason: Option<&str>, ) -> Result<AgendaItem>

POST /kernel/agenda/{id}/reject.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn schedule_item(&self, id: &str, wake: WakeSet) -> Result<AgendaItem>

POST /kernel/agenda/{id}/schedule: puts the approved item’s process to sleep on wake.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn issue_pairing_code( &self, request: &IssueRequest, ) -> Result<IssuedCode>

POST /kernel/pairing: issues a pairing code for a device acting for the caller (spec 3.3 §10 K2, adk-rust pair).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 without the operator scope, 400 when the kernel pairs no devices.

Source

pub async fn claim_pairing( &self, code: &str, name: Option<&str>, ) -> Result<ClaimedDevice>

POST /kernel/pairing/claim: pairs this client’s device with code and returns its token, once (spec 3.3 §10 K2). The call needs no token and sends none, so a client whose old token was revoked or expired re-pairs; send the one it returns with with_bearer_token from then on.

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 401 for a wrong, used or expired code.

Source

pub async fn devices(&self) -> Result<Vec<DeviceView>>

GET /kernel/devices: every paired device (spec 3.3 §10 K2, adk-rust pair list).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered.

Source

pub async fn revoke_device(&self, id: &str) -> Result<DeviceView>

POST /kernel/devices/{id}/revoke: removes a device; its token stops working at once (spec 3.3 §10 K2, adk-rust pair revoke).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 for an unknown device.

Source

pub async fn channel_accounts(&self) -> Result<ChannelAccountsResponse>

GET /kernel/channels: the paired chat accounts and the ones waiting for their code to be accepted (spec 3.3 §10 K1).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered; a kernel without chat channels answers none.

Source

pub async fn accept_channel(&self, code: &str) -> Result<ChannelAccountView>

POST /kernel/channels/pair: accepts the code a chat account was sent, so its messages reach the caller’s agents (spec 3.3 §10 K1).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 401 for a wrong or expired code, 400 when the kernel has no chat channels.

Source

pub async fn revoke_channel_account( &self, id: &str, ) -> Result<ChannelAccountView>

POST /kernel/channels/{id}/revoke: removes a chat account (spec 3.3 §10 K1).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 for an unknown account.

Source

pub async fn dismiss_channel_request( &self, id: &str, ) -> Result<ChannelPairingView>

POST /kernel/channels/waiting/{id}/dismiss: dismisses a chat account waiting to be paired; its code stops working (spec 3.3 §10 K1).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 404 for an account that is not waiting.

Source§

impl ControlClient

Source

pub async fn commands(&self) -> Result<Vec<CommandInfo>>

GET /kernel/commands: the REPL’s commands the kernel offers, in /help order (spec 3.3 §5.2).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 400 when the kernel offers none.

Source

pub async fn run_command( &self, name: &str, args: &str, session: &str, ) -> Result<String>

POST /kernel/commands/run: runs /name args in the caller’s session session, by the REPL’s code on the kernel’s harness; returns what it printed (spec 3.3 §5.2).

§Errors

As commands, and 404 for a command the kernel does not offer, 409 for one that changes something while everything is stopped, or the command’s error.

Source

pub async fn always_allow_offer(&self, id: &str) -> Result<Option<String>>

GET /kernel/rules/always-allow/{id}: the words of “Always allow” for the caller’s waiting decision id, or None when no standing rule applies (spec 3.3 §8.2).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 409 for a decision no longer waiting.

Source

pub async fn prepare_always_allow(&self, id: &str) -> Result<String>

POST /kernel/rules/always-allow/{id}/prepare: makes the standing rule “Always allow” creates for the waiting decision id, before it is answered; returns its words (spec 3.3 §8.2).

§Errors

As always_allow_offer, and 400 when no rule applies.

Source

pub async fn grant_always_allow(&self, id: &str) -> Result<()>

POST /kernel/rules/always-allow/{id}/grant: grants the rule prepared for the decision id once it was allowed (spec 3.3 §8.2).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 409 for a decision not allowed, 404 when no rule was prepared for it.

Source

pub async fn session_mode(&self, session: &str) -> Result<Option<String>>

GET /kernel/sessions/{session}/mode: the mode of the caller’s session session, as the harness names it, or None when the kernel keeps no modes (spec 3.3 §5.2).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 400 when the kernel offers no commands.

Source

pub async fn record_surface(&self, record: &SurfaceRecord) -> Result<()>

POST /kernel/surface/records: writes record, one record of a surface engine in this process, on the kernel’s signed log, with the caller as its actor (spec 3.3 §11).

§Errors

Returns KernelError::ControlPlane when the kernel cannot be reached, or the error the kernel answered: 403 for a device token, 400 for an action that is not a surface’s, 404 for an answer to a decision that is not the caller’s, or the log’s error.

Trait Implementations§

Source§

impl Clone for ControlClient

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 ControlClient

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for ControlClient

§

impl !UnwindSafe for ControlClient

§

impl Forget for ControlClient

§

impl Freeze for ControlClient
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const ArcInner<ClientRef> is !null: Freeze, PhantomData<ArcInner<ClientRef>>: Freeze,

§

impl Move for ControlClient

§

impl Send for ControlClient
where RawVecInner: Send, Arc<ClientRef>: Send,

§

impl Sync for ControlClient
where RawVecInner: Sync, Arc<ClientRef>: Sync,

§

impl Unpin for ControlClient
where *const u8 is !null: Unpin, Arc<ClientRef>: Unpin,

§

impl UnsafeUnpin for ControlClient
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const ArcInner<ClientRef> is !null: UnsafeUnpin, PhantomData<ArcInner<ClientRef>>: 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