Skip to main content

SessionRegistry

Struct SessionRegistry 

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

The daemon-owned session registry (Axiom 4).

Why: single source of truth for every session’s state, in-memory only (§12, M1) — see the module docs for the full rationale. What: see method docs below; new() uses DEFAULT_RING_CAPACITY, with_capacity lets tests use a tiny buffer to exercise eviction cheaply. Test: registry_tests::*.

Implementations§

Source§

impl SessionRegistry

Source

pub fn record_tool_started( &self, id: &str, tool: &str, call_id: &str, args: &str, ) -> Result<(), RpcError>

Record a tool invocation starting (#2055 emission plumbing for #2056’s agent loop).

Why: gives the future agent loop a stable, already-wired call for ToolStarted without it needing to touch the ring buffer, sequencing, or bus directly. What: errors with session_not_found if id is unknown; args_preview is truncated via crate::events::preview before emission so a large argument payload can’t blow the ring buffer / wire size. Test: registry_tests::record_tool_started_publishes_event.

Source

pub fn record_tool_finished( &self, id: &str, tool: &str, call_id: &str, success: bool, result: &str, ) -> Result<(), RpcError>

Record a tool invocation finishing (#2055 emission plumbing for #2056’s agent loop). See Self::record_tool_started. Test: registry_tests::record_tool_finished_publishes_event.

Source

pub fn record_tool_error( &self, id: &str, tool: &str, call_id: &str, error: &str, ) -> Result<(), RpcError>

Record a tool invocation raising an exceptional error (#2055 emission plumbing for #2056’s agent loop). See Self::record_tool_started. Test: registry_tests::record_tool_error_publishes_event.

Source

pub fn record_log( &self, id: &str, level: &str, message: &str, ) -> Result<(), RpcError>

Record a session-scoped diagnostic log line (#2055 emission plumbing). Test: registry_tests::record_log_publishes_event.

Source

pub fn record_progress( &self, id: &str, message: &str, percent: Option<f32>, ) -> Result<(), RpcError>

Record a coarse progress update (#2055 emission plumbing). Test: registry_tests::record_progress_publishes_event.

Source

pub fn record_message(&self, id: &str, text: &str) -> Result<(), RpcError>

Record a generic freeform session message (#2055 emission plumbing). Test: registry_tests::record_message_publishes_event.

Source§

impl SessionRegistry

Source

pub fn memory_sink_for( &self, id: &str, project_dir: &Path, ) -> Option<Arc<TurnMemorySink>>

Lazily construct (on first call) or return (on every later call) this session’s durable turn-recorder sink.

Why: task::executor::run_and_record needs the SAME Arc<TurnMemorySink> — and therefore the same background drain task and bounded queue — across every task.run on one session, not a fresh one per run (a fresh sink per run would spawn a new drain task each time, multiplying in-flight writers with no bound). Constructing it here, inside the session-map lock, means two calls can never build two different sinks for the same session even under a hypothetical race (in practice Self::begin_execution’s single-in-flight-run guard already prevents concurrent calls per session). What: None if id is unknown (best-effort — mirrors Self::set_run_outcome’s framing; the caller has already validated the session’s existence earlier in the same run via begin_execution/begin_pm_transcript). On the FIRST call for a session, derives the palace id from project_dir via derive_palace_id_for_project, resolves trusty-memory’s base URL via trusty_common::mcp::memory_rpc::resolve_memory_base_url_or_unreachable (fail-open — the sink is built regardless of whether the daemon is currently reachable; every write attempt after that is independently fail-open, see memory_sink::write_turn), and stores the constructed Arc. On every SUBSEQUENT call, project_dir is ignored and the already-built sink is returned unchanged — a session’s palace/base-url binding is fixed for its lifetime, mirroring Self::begin_pm_transcript’s analogous “the system prompt is fixed after the first call” rule. Test: registry_tests::memory_sink_for_reuses_the_same_sink_across_calls, registry_tests::memory_sink_for_unknown_session_returns_none.

Source§

impl SessionRegistry

Source

pub fn set_goal( &self, id: &str, slot: usize, text: &str, ) -> Result<(), RpcError>

session.set_goal: write an operator-provided goal into a 1-based slot (#2350).

Why: the operator-facing counterpart to the model-facing set_goal tool (#2347) — same shared GoalSlots, tagged GoalSource::Operator so a later read can tell the two apart. What: Err(session_not_found) if id is unknown. Err(invalid_argument) if the session has no pm_transcript yet (see module docs’ design decision) or if slot is 0/greater than GOAL_SLOT_COUNT. A poisoned goals lock is recovered (mirrors tools::goals’s convention) rather than propagating a panic. Test: registry_tests::set_goal_writes_operator_source, registry_tests::set_goal_no_transcript_yet_errors, registry_tests::set_goal_out_of_range_slot_errors, registry_tests::set_goal_unknown_session_errors.

Source

pub fn clear_goal(&self, id: &str, slot: usize) -> Result<(), RpcError>

session.clear_goal: clear an operator-named 1-based slot (#2350).

Why: the operator-facing counterpart to the model-facing clear_goal tool (#2347). What: same error shape as Self::set_goal. Clearing an already-empty slot is idempotent success (mirrors GoalSlots::clear’s own convention). Test: registry_tests::clear_goal_clears_slot, registry_tests::clear_goal_no_transcript_yet_errors, registry_tests::clear_goal_out_of_range_slot_errors.

Source

pub fn get_goals(&self, id: &str) -> Result<Vec<GoalSlotRecord>, RpcError>

session.get_goals: snapshot every currently-occupied goal slot (#2350).

Why: the operator-facing read path — lets a client inspect the current goal state (from either source) without going through session.get_transcript’s larger payload. What: Err(session_not_found) if id is unknown; otherwise [goal_records] — [] for a session with no pm_transcript yet, matching session.get_transcript’s never-run convention rather than set_goal/clear_goal’s stricter error. Test: registry_tests::get_goals_returns_operator_and_model_sources, registry_tests::get_goals_on_never_run_session_is_empty, registry_tests::get_goals_unknown_session_errors.

Source§

impl SessionRegistry

Source

pub fn new() -> Self

Construct an empty registry with the default ring-buffer capacity.

Source

pub fn with_capacity(ring_capacity: usize) -> Self

Construct an empty registry with an explicit ring-buffer capacity.

Why: unit tests need a small capacity to exercise eviction without pushing 1000 events.

Source

pub fn create( &self, task: String, agent: Option<String>, project: Option<String>, ) -> Session

session.create: register a brand-new session and publish its lifecycle-start events.

Why: the sole entry point that mints a session id and puts a Session into the registry. What: builds a Session with a fresh UUIDv4 id and status = Created, inserts it (with a fresh seq = 0 counter), publishes Event::SessionStarted (assigned seq = 1), then immediately transitions to Running (M1 has no queue ahead of real task execution — see session::model docs) which publishes Event::SessionStatusChanged (seq = 2). Returns the post-transition snapshot (so the caller sees status: "running", not the momentary "created"). Test: registry_tests::create_publishes_started_and_status_events.

Source

pub fn list(&self) -> Vec<Session>

session.list: snapshot every session currently in the registry.

Why: the read side of the registry for operators/CLI/TUI to enumerate running sessions. What: clones every Session snapshot; order is unspecified (backed by a HashMap). Test: registry_tests::list_returns_every_created_session.

Source

pub fn status(&self, id: &str) -> Result<Session, RpcError>

session.status: snapshot one session by id.

Why: shared by create’s return value and the standalone session.status method. What: Ok(Session) if present, Err(RpcError::session_not_found) otherwise. Test: registry_tests::status_returns_not_found_for_unknown_id.

Source

pub fn send(&self, id: &str, input: &str) -> Result<(), RpcError>

session.send: deliver input to a session and publish an observable event proving the daemon received it.

Why: #2054/#2055 do not wire a real agent loop (that is task.*, #2056); publishing Event::SessionInput is what makes session.send observably reach a session.attached client NOW, and gives #2056 a concrete event to build real echo/ack behaviour on top of. What: errors with session_not_found if id is unknown; otherwise records+publishes Event::SessionInput { session_id, input }. Test: registry_tests::send_publishes_input_event, registry_tests::send_unknown_session_errors.

Source

pub fn cancel(&self, id: &str) -> Result<Session, RpcError>

session.cancel: send a cancellation signal and mark the session terminal.

Why: vision spec §12 (11.6) Cancellation Semantics — cancellation is a status transition + event, not a deletion. #2054/#2055 have no in-flight agent loop to interrupt yet (that lands with #2056), so this is the full implementation available today: it marks the session Cancelled and publishes the terminal events; #2056 hooks the actual agent-loop interrupt onto the same status transition. What: idempotent — cancelling an already-terminal session is a no-op that returns the current snapshot rather than erroring (repeated session.cancel calls are safe). Errors with session_not_found if id is unknown. On a live session: publishes Event::SessionStatusChanged (status: "cancelled"), then the dedicated Event::SessionCancelled signal, then the generic terminal Event::SessionDone (status: "cancelled") — matching the vision spec’s started/status-changed/input/cancelled/done taxonomy — and returns the updated snapshot. Test: registry_tests::cancel_transitions_to_cancelled_and_publishes, registry_tests::cancel_is_idempotent_on_terminal_session, registry_tests::cancel_unknown_session_errors.

Source

pub fn finish( &self, id: &str, status: SessionStatus, ) -> Result<Session, RpcError>

Mark a session terminal (finished, failed, or cancelled while executing) and publish the terminal Event::SessionDone (#2056).

Why: the background executor (crate::task::executor) needs to set the FINAL status once an agent loop returns, distinctly from the user-initiated session.cancel JSON-RPC path (Self::cancel), which ALSO emits a dedicated Event::SessionCancelled signal that only makes sense for an explicit user cancel request — not a natural finish or failure, and not a cancellation the EXECUTOR itself observed (that path already went through request_cancel, which does not transition status; the executor calls this afterward to actually land the transition once it has unwound). What: idempotent — a no-op (returns the current snapshot) if the session is already terminal, since a race between request_cancel’s caller and the executor noticing cancellation is possible but harmless. Errors with session_not_found if id is unknown. Otherwise transitions to status and publishes Event::SessionDone { status }. Test: registry_tests::finish_transitions_and_publishes_session_done, registry_tests::finish_is_idempotent_on_terminal_session, registry_tests::finish_unknown_session_errors.

Source

pub fn attach( &self, id: &str, connection_id: Uuid, notify: NotifySender, ) -> Result<Vec<SessionEventEnvelope>, RpcError>

session.attach: replay recent history and start forwarding this session’s live events to notify.

Why: the streaming half of the session-attach protocol (vision spec §4.4/Axiom 4). Works identically regardless of transport — the difference between STDIO (long-lived notify, events interleaved on stdout) and HTTP (throwaway notify; the real live path is the GET /sessions/{id}/events SSE route) lives entirely in crate::jsonrpc::ConnectionContext’s docs and crate::serve’s transports, not here. What: errors with session_not_found if id is unknown. Otherwise takes a snapshot of the ring buffer (oldest-first, each entry a full SessionEventEnvelope with its seq intact) to return as the replay, registers connection_id’s cancel sender (replacing — and thus cancelling — any prior forwarder for the same (session, connection) pair), and spawns a task that subscribes to crate::events::subscribe(), filters by session_id, and forwards each match into notify as a JSON-RPC notification whose params IS the envelope ({"jsonrpc":"2.0","method":"session.event","params": {"session_id":...,"seq":...,"at":...,"kind":...,"event":{...}}}) until detach fires the cancel sender or notify.send fails (the connection is gone). Because every envelope — replayed or live — comes from the SAME per-session seq counter (record), a client that concatenates the replay array with the live notifications it receives afterward sees one gap-free, strictly increasing sequence. Test: registry_tests::attach_returns_ring_buffer_replay, registry_tests::attach_forwards_live_events_until_detach, registry_tests::attach_replay_then_live_seq_is_contiguous, registry_tests::attach_unknown_session_errors.

Source

pub fn detach(&self, id: &str, connection_id: Uuid) -> Result<(), RpcError>

session.detach: stop forwarding this session’s live events to the calling connection.

Why: the other half of the attach protocol — releases the forwarder task started by attach for this (session, connection) pair. What: errors with session_not_found if id is unknown. If the connection has no live attachment (already detached, or never attached), this is a no-op success rather than an error — detach is idempotent. Otherwise fires the stored cancel sender, which stops the forwarder task on its next select! poll. Test: registry_tests::detach_stops_the_forwarder, registry_tests::detach_without_prior_attach_is_a_noop, registry_tests::detach_unknown_session_errors.

Source

pub fn replay(&self, id: &str) -> Result<Vec<SessionEventEnvelope>, RpcError>

Snapshot the ring buffer for a session without attaching to it.

Why: the HTTP SSE route (crate::serve::http) needs the same replay burst attach returns, but subscribes to the live bus itself (one Stream per SSE connection) rather than going through a NotifySender forwarder — so it calls this directly instead of attach. What: same replay semantics as attach (full envelopes, seq intact), no side effects (no forwarder spawned, no attachment recorded). Test: registry_tests::replay_returns_ring_buffer_without_attaching.

Source

pub fn begin_execution(&self, id: &str) -> Result<Arc<AtomicBool>, RpcError>

Begin tracking a new background task execution for id (#2056; #2344 resumption semantics).

Why: task.run (and session.send on an idle session) must not start a second overlapping run for the same session, and the returned flag is how the executor’s AgentLoop(s) later observe cancellation. (#2344) A session that already Finished a previous run is NOT dead — per the infinite-sessions design, it is simply idle and ready for its next task.run to continue the SAME persistent conversation (Self::begin_pm_transcript). Only Cancelled/Failed/ DeadlineExceeded remain genuinely terminal: those represent a broken run, and resuming one still requires a fresh session. What: errors with session_not_found if id is unknown, invalid_argument if the session is Cancelled/Failed/ DeadlineExceeded, or already has an execution in flight — this SINGLE in-flight-execution guard is also this ticket’s concurrency guard for pm_transcript: two overlapping task.run calls on one session can never both hold the transcript, because the second one is rejected here before either reaches begin_pm_transcript. On success, stores a fresh Arc<AtomicBool> cancel flag (initially false) with handle: None — the caller attaches the real JoinHandle via Self::attach_execution_handle immediately after spawning, since the handle cannot exist before that — and returns the flag. If the session was Finished (resuming), transitions it back to Running and publishes Event::SessionStatusChanged — matching the transition every other status change in this module publishes. Test: registry_tests::begin_execution_rejects_second_overlapping_run, registry_tests::begin_execution_rejects_terminal_session, registry_tests::begin_execution_unknown_session_errors, registry_tests::begin_execution_resumes_a_finished_session.

Source

pub fn attach_execution_handle(&self, id: &str, handle: JoinHandle<()>)

Attach the real JoinHandle to id’s tracked execution (#2056).

Why: the handle only exists once the caller has actually called tokio::spawn, which must happen after begin_execution returns (the spawned future needs the cancel flag begin_execution produces). What: best-effort — a no-op if id or its execution is already gone (e.g. the run finished astonishingly fast, or the session vanished). Test: registry_tests::shutdown_executions_awaits_cancelled_tasks (exercises this indirectly via a real spawn).

Source

pub fn finish_execution(&self, id: &str)

Clear the execution-in-flight marker for id (#2056).

Why: called by the executor once the background task has stopped (finished, failed, or cancelled) so a later task.run/session.send can start a new run against the same session. What: best-effort — a no-op if id is already gone. Test: registry_tests::begin_execution_rejects_second_overlapping_run (calls this between the two begin_execution attempts).

Source

pub fn is_executing(&self, id: &str) -> bool

Whether id currently has a background execution in flight (#2056).

Why: session::protocol::cancel uses this to choose between cooperative cancellation (Self::request_cancel) and the original #2054 immediate-transition Self::cancel. What: false for both “unknown session” and “known but idle” — callers that need to distinguish those already call another method first. Test: registry_tests::request_cancel_*.

Source

pub fn request_cancel(&self, id: &str) -> Result<bool, RpcError>

Request cooperative cancellation of id’s in-flight execution, if any (#2056).

Why: session.cancel on a RUNNING session must signal the background task rather than force an immediate status transition — the task itself transitions to Cancelled once it actually observes the flag and unwinds (see crate::task::executor). What: Err(session_not_found) if id is unknown. Ok(true) if an execution was in flight and its flag was set; Ok(false) if the session exists but nothing is executing (the caller should fall back to Self::cancel for the immediate-transition path). Test: registry_tests::request_cancel_sets_flag_when_executing, registry_tests::request_cancel_returns_false_when_idle.

Source

pub fn set_run_outcome( &self, id: &str, transcript: Vec<TurnRecord>, usage: TokenUsage, cost_usd: Option<f64>, )

Persist a finished execution’s transcript/usage/cost into the session (#2056; #2344 made CUMULATIVE across runs).

Why: populates the storage Self::get_transcript (#2058) reads back over the wire. (#2344) A session’s turns/usage/cost now accumulate across every task.run rather than the last run overwriting the previous one’s — the whole point of a persistent session is that session.get_transcript shows the FULL conversation, not just its most recent slice. What: best-effort — a no-op if id is already gone (e.g. the daemon is shutting down mid-run). transcript is APPENDED onto the existing turns (not replacing them); usage is added field-wise via TokenUsage::add (the same accumulator run_task::aggregate_usage_per_role uses internally); cost_usd sums the two Option<f64>s the same way TokenUsage::add combines its own cost_usd field (Some+Some -> sum, either Some alone passes through, None+None stays None). Test: registry_tests::set_run_outcome_stores_transcript_and_usage, registry_tests::set_run_outcome_accumulates_across_two_calls.

Source

pub fn begin_pm_transcript( &self, id: &str, system: &str, task: &str, ) -> Result<Transcript, RpcError>

Retrieve this session’s persistent PM conversation Transcript, seeding it on the session’s FIRST task.run and appending task as a new user turn onto the existing history on every SUBSEQUENT one (#2344 — the infinite-sessions conversation-continuity entry point).

Why: task::executor::run_and_record must hand the PM’s AgentLoop the SAME growing Transcript every run drives via AgentLoop::run_with_transcript, rather than reseeding fresh each time (the pre-#2344 behaviour). Taking ownership OUT of the entry (rather than cloning) lets the caller drive the loop against it directly with no extra copy; briefly leaving None in storage while a run is active can never be observed by a second concurrent caller — Self::begin_execution’s single-in-flight-run guard already rejects a second task.run on the same session before it would ever reach this method (see that method’s docs). What: Err(session_not_found) if id is unknown. If pm_transcript is None (the session has never run, or is between runs having been taken and not yet restored — the call-order guarantee above means the latter should never actually happen), seeds a fresh Transcript::seed(system, task). If Some, takes the existing transcript out of storage and appends task as a new user turn via Transcript::push_user — system is IGNORED on this branch: the original seed’s system message stays authoritative for the life of the session (a refresh mechanism, if agent/mode config changes between runs, is future work — not this ticket). Test: registry_tests::begin_pm_transcript_seeds_on_first_call, registry_tests::begin_pm_transcript_appends_on_second_call, registry_tests::begin_pm_transcript_unknown_session_errors.

Source

pub fn store_pm_transcript(&self, id: &str, transcript: Transcript)

Persist the PM’s conversation Transcript back onto the session once a run ends (#2344).

Why: pairs with Self::begin_pm_transcript — MUST be called regardless of the run’s outcome (success, failure, cancellation, or timeout) so the conversation up to the point of interruption survives for the NEXT task.run to continue from, rather than the session being left with no pm_transcript at all (which would silently re-seed from scratch on the next run instead of erroring). What: best-effort — a no-op if id is already gone (mirrors Self::set_run_outcome’s same best-effort framing). Test: registry_tests::begin_pm_transcript_appends_on_second_call (exercises both halves of the round trip).

Source

pub fn get_transcript(&self, id: &str) -> Result<TranscriptRecord, RpcError>

session.get_transcript: fetch the stored run record for a session (#2058).

Why: Self::set_run_outcome populates the storage; this is its read counterpart — the M1 cut-line’s “inspect transcript” verb. A never-run session is a valid, empty transcript, not an error: SessionEntry’s transcript/usage/cost_usd fields already default to empty/zero/None at create time, so returning them unconditionally (once the session itself is confirmed to exist) is correct with no extra branching. What: Err(session_not_found) if id is unknown; otherwise a clone of whatever is currently stored, wrapped in a self-describing TranscriptRecord. Never recomputes cost or usage — exposes exactly what Self::set_run_outcome last stored. compaction_events (#2349) reads entry.pm_transcript’s own cumulative counter — 0 when the session has never run (pm_transcript still None). Test: registry_tests::get_transcript_returns_stored_record, registry_tests::get_transcript_on_never_run_session_is_empty, registry_tests::get_transcript_unknown_session_errors, registry_tests::get_transcript_reports_compaction_events, registry_tests::get_transcript_round_trips_goal_state.

Source

pub fn set_mode(&self, id: &str, mode: HarnessMode) -> Result<(), RpcError>

task.run: persist the resolved HarnessMode onto the session (#2059).

Why: task::protocol::task_run resolves the mode (env var > task.run param > .claude/settings.json > default) BEFORE spawning the execution; storing it here — rather than waiting for set_run_outcome at the end of the run — makes it queryable via session.status/session.list (Session.mode) and session.get_transcript (TranscriptRecord.mode, which reads the SAME field) as soon as task.run returns, not only after the run completes. What: Err(session_not_found) if id is unknown; otherwise sets entry.session.mode = Some(mode). No event is published — mode is bookkeeping metadata, not a session-lifecycle transition in the #2055 event taxonomy. Test: registry_tests::set_mode_stores_on_session, registry_tests::set_mode_unknown_session_errors.

Source

pub async fn shutdown_executions(&self, grace: Duration)

Cooperatively cancel every in-flight execution and wait, bounded by grace, for them to actually stop (#2056 — graceful daemon shutdown).

Why: without this, a tokio::spawn’d background execution would be abruptly dropped — never given a chance to unwind — the instant the process’s tokio runtime shuts down, violating the connection-safe daemon-restart convention (issue #534) this extends from connections to long-running tasks. What: flips every tracked execution’s cancel flag, takes ownership of each JoinHandle, then awaits all of them concurrently with an overall grace timeout. A handle that doesn’t finish in time is left to be dropped when the process exits (best-effort, not a hard guarantee — matching the same best-effort framing as every other shutdown step in this codebase). Test: registry_tests::shutdown_executions_awaits_cancelled_tasks.

Trait Implementations§

Source§

impl Default for SessionRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<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