Skip to main content

SurfaceEngine

Struct SurfaceEngine 

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

The engine every surface runs on (spec 3.3 §6): it reads a Source, projects what it reads into cards, thread items, agent rows, the status line and the briefing, and carries out commands under the rules of §7.2 and §7.4.

Surfaces hold no state a reconnect cannot rebuild: everything here is read from the source’s stores, except input queued behind an open decision or a running turn, which waits in this process and is sent, oldest first, once the session is free — whichever surface answered the decision. A message queued behind a running turn is offered to that turn (§6 “steer”): it leaves the queue when the turn takes it, and stays in its place when the turn hands it back, so it reaches the agent exactly once.

§Example

use std::sync::Arc;
use adk_surface::{Caller, LocalSource, Origin, SurfaceEngine, SurfaceKind};

let source = LocalSource::builder("adk-rust").sessions(sessions).approvals(approvals).build()?;
let engine = SurfaceEngine::builder(Arc::new(source)).build();
let me = Caller::human("ana", SurfaceKind::Web, Origin::Pointer);
for card in engine.decisions(&me).await? {
    println!("{} · {}", card.heading, card.status_text);
}

Implementations§

Source§

impl SurfaceEngine

Source

pub async fn cameras_view(&self, caller: &Caller) -> Result<CamerasView>

Every camera caller may see, as the grid shows them (spec 3.7 §8.2, board choice C8).

§Errors

surface.unsupported when the engine serves no cameras; the source’s error.

Source

pub async fn camera_view( &self, caller: &Caller, camera: &str, ) -> Result<CameraView>

Camera camera, watched large (spec 3.7 §8.2, board choice C1): the picture with its overlays, the agent’s decisions, what it watches for, the frame budget, the tracks and every source.

§Errors

surface.not_found when the camera is not one of caller’s; surface.unsupported when the engine serves no cameras; the source’s error.

Source

pub async fn camera_stage( &self, caller: &Caller, camera: &str, ) -> Result<StageView>

Camera camera’s picture alone, as its feed sends it after each frame.

§Errors

As camera_view.

Source

pub async fn freeze_camera_frame( &self, caller: &Caller, camera: &str, frame: &str, ) -> Result<StageView>

Freezes frame frame of camera for a card (board choice C11): the hub holds it in memory while the person writes what the agent should look at. Returns the picture of that frame with what was found on it. Nothing is written.

§Errors

surface.not_found when the camera is not caller’s or the frame is no longer held; surface.not_here from anything but a person at a screen.

Source

pub async fn camera_frame( &self, caller: &Caller, camera: &str, digest: &str, ) -> Result<EvidenceBytes>

The frame of camera with digest, while the hub holds it in memory, its bytes checked against the digest (spec 3.7 §8.3). A camera that is off holds none.

§Errors

surface.not_found when the camera is not caller’s or the frame is no longer held.

Source

pub async fn switch_camera( &self, caller: &Caller, camera: &str, on: bool, ) -> Result<CameraView>

Switches camera on or off for caller (board choice C2). Off closes the hub’s gate before anything else, so the server drops every frame from then on, and forgets the frames it held; then it is recorded and the source told. On is recorded first.

§Errors

surface.not_found when the camera is not caller’s; surface.not_here from anything but a person at a screen; the source’s error.

Source

pub async fn stop_camera( &self, caller: &Caller, camera: &str, ) -> Result<CameraView>

Ends camera’s stream for caller (board choice C2): the gate closes for good, then it is recorded and the source told.

§Errors

As switch_camera.

Source

pub async fn send_camera_frame( &self, caller: &Caller, camera: &str, mime_type: &str, bytes: Vec<u8>, ) -> Result<FrameTaken>

Takes one frame caller’s screen captured for camera — the web home’s or the phone’s own camera — and hands it to the camera’s frame pipeline through the hub’s gate (Cameras::ingest): while the camera is off, stopped or paused by Stop all the frame is dropped and the answer says why, so the screen stops capturing. A camera switched off sends nothing. Nothing is held or written here; the pipeline shows what it makes of the frame. Frames are not recorded one by one: switching the camera is.

§Errors

surface.not_found when the camera is not caller’s; surface.not_here from anything but a person at a screen; surface.invalid for an empty frame, one over MAX_SENT_FRAME_BYTES, or one that is not the JPEG, PNG or WebP mime_type says; surface.unsupported for a camera that reads its own source; surface.rate_limited for a frame sooner than MAX_SCREEN_FPS allows.

Source

pub async fn retry_camera( &self, caller: &Caller, camera: &str, ) -> Result<CameraView>

Tries a lost camera again now (board choice C6).

§Errors

As switch_camera; surface.unsupported when the source cannot.

Source

pub async fn save_camera_zone( &self, caller: &Caller, camera: &str, zone: &str, change: &ZoneChange, ) -> Result<ZoneSaved>

Changes zone zone of camera (board choice C12): every watch that uses it reads the new corners from its next frame. A zone changed since the person started is refused, never overwritten. Recorded before it is saved.

§Errors

surface.not_found for another’s camera or an unknown zone; surface.invalid for corners outside the frame, an empty name, or a zone that changed; surface.not_here from a paired device or anything but a person at a screen; the source’s error.

Source

pub async fn raise_camera_card( &self, caller: &Caller, camera: &str, card: &RaiseCard, ) -> Result<CardRaised>

Raises a card from a frozen frame of camera (board choice C11): that one frame is kept as evidence — blurred first by the source, kept EVIDENCE_RETENTION_DAYS days — with the regions on it, and the card goes to the watching agent as caller’s message, naming the evidence by digest and artifact, never carrying pixels (spec 3.7 V-I15). Nothing else is stored. Recorded before the frame is kept.

§Errors

surface.not_found when the camera is not caller’s or the hub no longer holds the frame; surface.invalid for an empty note; surface.not_here from anything but a person at a screen; the source’s error, and nothing is kept then.

Source§

impl SurfaceEngine

Source

pub fn builder(source: Arc<dyn Source>) -> SurfaceEngineBuilder

A builder over source.

Source

pub fn source(&self) -> &Arc<dyn Source> ⓘ

The source.

Source

pub fn camera_hub(&self) -> Option<&Cameras>

The cameras of the live camera surface, when the engine serves them (spec 3.7 §8.2).

Source

pub fn granted(&self) -> &[GrantedUse]

What every agent the home runs may also do, as the host granted it (spec 3.3 §5.7).

§Example
use std::sync::Arc;
use adk_surface::{LocalSource, SurfaceEngine};

let engine = SurfaceEngine::builder(Arc::new(source)).build();
assert!(engine.granted().is_empty());
Source

pub fn catalogs(&self) -> &Catalogs

The catalogs this engine shows drawings in: forms and every catalog registered with SurfaceEngineBuilder::with_catalog (spec 3.3 §6.1 genui).

Source

pub async fn decisions(&self, caller: &Caller) -> Result<Vec<DecisionCard>>

The decisions waiting for caller, oldest first, drawn from their inbox entries (spec 3.3 §7.1, S-I1).

§Errors

Returns the source’s error.

Source

pub async fn session_decisions( &self, caller: &Caller, session: &str, ) -> Result<Vec<DecisionCard>>

The decisions of one session waiting for caller, oldest first (spec 3.3 §10 C1).

§Errors

Returns the source’s error.

Source

pub async fn decision(&self, caller: &Caller, id: &str) -> Result<DecisionCard>

One decision as caller sees it: waiting, or decided with who, where and when.

§Errors

Returns surface.not_found when no decision of the caller has id (S-I8), or the source’s error.

Source

pub async fn decided_since( &self, caller: &Caller, since: DateTime<Utc>, ) -> Result<Vec<DecisionCard>>

The caller’s decisions answered or ended since since, newest first, for a surface that opens again after a while, such as the phone (spec 3.3 §5.4).

§Errors

Returns the source’s error.

Source

pub async fn evidence_image( &self, caller: &Caller, id: &str, index: usize, ) -> Result<EvidenceBytes>

The indexth image decision id holds as evidence, for caller (spec 3.7 §8.3): only a decision the caller may see, its bytes checked against the evidence’s digest by the source.

§Errors

surface.not_found when the caller has no such decision or image, or the image is no longer kept; the source’s error.

Source

pub async fn viewer( &self, caller: &Caller, session: &str, image: &str, answer: Option<&str>, compare: Option<&str>, ) -> Result<ViewerView>

The annotated viewer of image image — a sha256: digest, or the name of an image the session holds — in caller’s session (spec 3.7 §8.2, X12): every answer the vision tools gave for it, answer shown (the newest otherwise), compare beside it.

§Errors

surface.not_found when the caller has no such session or the session no such image; the source’s error.

Source

pub async fn viewer_image( &self, caller: &Caller, session: &str, image: &str, ) -> Result<EvidenceBytes>

The bytes of image image (a digest or a name) of caller’s session, checked against its digest (spec 3.7 §8.3).

§Errors

surface.not_found when the caller has no such session or image; the source’s error.

Source

pub async fn viewer_export( &self, caller: &Caller, session: &str, answer: &str, with: Option<&str>, ) -> Result<Value>

The RegionSet of answer answer in caller‘s session, as the vision tools published it (board choice V14); with with, both answers’ sets in an array.

§Errors

surface.not_found when the caller has no such session or answer.

Source

pub async fn save_example( &self, caller: &Caller, session: &str, example: &LabelledExample, ) -> Result<SavedExample>

Saves a labelled example from an answer in caller’s session (board choices V11–V13): an adk-eval case in the eval set example.file, its image beside the file. The run’s answer is untouched; the example is recorded (surface.vision.example).

§Errors

surface.not_found when the caller has no such session or answer; surface.invalid when the example does not fit the answer or the file; surface.unsupported when the source saves no examples.

Source

pub async fn thread( &self, caller: &Caller, session: &str, ) -> Result<Vec<FeedEntry>>

The session’s thread: every event of its store, numbered by position (spec 3.3 §6).

§Errors

Returns surface.not_found when the caller has no such session (S-I8), or the source’s error.

Source

pub fn feed( &self, caller: Caller, session: String, after: Option<u64>, ) -> BoxStream<'static, Result<FeedFrame>>

The session’s feed (spec 3.3 §6): every event after after (none: from the start) as an Entry numbered by its position in the session store, the session’s open decisions, then the live tail. Resuming with the last seq received never skips or repeats an event.

While the stream runs, a history the store replaced — rewound, or deleted and started again — sends Reset and the entries again from the start, whether it got shorter or grew back past what was sent. A client that resumes after after is trusted to hold the store’s events up to it.

A turn that ends in an error leaves no event, so the entry it follows is sent again as Changed, ending with a TurnFailed item; a resumed stream sends each entry before after that carries one.

The stream ends with an error when the session cannot be read.

Source

pub async fn agents(&self, caller: &Caller) -> Result<Vec<AgentRow>>

The caller’s agents (spec 3.3 §8.1).

§Errors

Returns the source’s error.

Source

pub async fn answers_since( &self, caller: &Caller, since: DateTime<Utc>, ) -> Result<AnswerSummary>

How caller answered since since (spec 3.3 §5.1 “How you answered”): each answer counted, and on which surfaces.

§Errors

Returns the answer log’s error.

Source

pub async fn agent_threads( &self, caller: &Caller, agent: &str, ) -> Result<AgentThreads>

The threads caller has with agent, newest first (spec 3.3 §5.1 “Thread history”): each session and when it last changed.

§Errors

Returns the source’s error.

Source

pub async fn removed_agents(&self, caller: &Caller) -> Result<Vec<RemovedAgent>>

The agents caller removed, each with its threads, which stay readable (spec 3.3 §5.7, §13 decision 18): what “Removed agents” at the roster’s foot lists.

§Errors

Returns the source’s error.

Source

pub async fn agent_details(&self, caller: &Caller) -> Result<Vec<AgentDetail>>

Every agent caller added, removed ones included, with its version: what the terminal’s --output json compares, so a change to any field is one line (spec 3.3 §5.7).

§Errors

Returns the source’s error.

Source

pub fn primary_agent(&self) -> Option<AgentRef>

The agent a message goes to when the person names none (spec 3.3 §5.5): the tray’s “Ask Finance”. None when the source has no single primary agent (Source::primary_agent).

Source

pub async fn status( &self, caller: &Caller, session: Option<&str>, ) -> Result<StatusLine>

The status line (spec 3.3 §5.1): the mode word of session (or the default), spend against the daily limit, quiet time, and the count of decisions.

§Errors

Returns the source’s error.

Source

pub fn serve(&self, part: Served)

Names part among the parts of the home this server serves beside the engine’s routes, so the web home reads its routes (StatusLine::serves). adk-surface’s routers name their own as they are built; a host names a part it mounts from elsewhere, such as the website’s desk.

§Example
use std::sync::Arc;
use adk_session::InMemorySessionService;
use adk_surface::{LocalSource, Served, SurfaceEngine};

let source = LocalSource::builder("adk-rust")
    .sessions(Arc::new(InMemorySessionService::new()))
    .build()
    .unwrap();
let engine = SurfaceEngine::builder(Arc::new(source)).build();
engine.serve(Served::Website);
assert_eq!(engine.serves(), vec![Served::Website]);
Source

pub fn serves(&self) -> Vec<Served>

The parts of the home this server serves beside the engine’s routes, in order: those named with serve, the cameras when the engine has a camera hub, and the kernel’s control plane when the source’s kernel built its routes.

Source

pub async fn briefing( &self, caller: &Caller, since: DateTime<Utc>, ) -> Result<Briefing>

“While you were away” since since (spec 3.3 §5.1, §8.1): spend, waiting decisions, and one line per event on the /proc ledger — the events the kernel’s GET /kernel/away lists (§10 K4) — each agent by the name the roster gives it.

§Errors

Returns the source’s error.

Source

pub async fn execute( &self, caller: &Caller, command: Command, ) -> Result<CommandOutcome>

Carries out command as caller (spec 3.3 §6, §7.2, §7.4, §11).

§Errors
CodeWhen
surface.not_foundNo decision or session of the caller has that id (S-I8); a Steer to a session that is not the caller’s
surface.answer_not_allowedThe surface may not give this answer (§7.2)
surface.confirm_presenceA high-risk approval without confirming it is you
surface.call_not_expandedA truncated call approved before it was expanded
surface.not_hereAn agent answering or steering, resuming outside the home, loosening the mode from chat or voice, a Steer while everything is stopped
surface.operator_onlyStop all or Resume all from a caller outside the group stops_need names
surface.invalidA spoken answer: it goes through decide_spoken with its transcript (feature voice)
surface.unsupportedThe source cannot do it
the source’s codeThe source failed
Source

pub async fn decide_spoken( &self, caller: &Caller, decision_id: &str, version: u64, answer: Answer, transcript: &str, ) -> Result<SpokenAnswer>

Answers a decision by voice (spec 3.3 §5.6, §7.2): the one way a spoken answer is recorded. transcript is what the person said; every surface.decide record of the answer carries its SHA-256 as transcriptDigest, and none carries the words.

The voice row of §7.2 applies: Allow once for an everyday call, which waits out the cancel window (CommandOutcome::Pending; its end arrives on SpokenAnswer::settled), and Deny for any call. The call counts as not expanded, so a call shown truncated is decided on screen.

§Errors

surface.invalid when caller is not on the voice surface with origin voice; the codes of execute otherwise.

§Example
use adk_surface::{Answer, Caller, CommandOutcome, Origin, SurfaceEngine, SurfaceKind};

let ana = Caller::human("ana", SurfaceKind::Voice, Origin::Voice);
let spoken = engine.decide_spoken(&ana, id, version, Answer::AllowOnce, "allow once").await?;
if let CommandOutcome::Pending { text, .. } = &spoken.outcome {
    println!("{text}");
}
Source

pub fn unqueue_last(&self, caller: &Caller, session: &str) -> Option<String>

Takes back the newest input queued for the session, before it is sent; None when none waits (spec 3.3 §7.4 rule 2), or when the session’s running turn holds the newest (§6 “steer”): the turn may take it at any moment.

Source

pub fn queued(&self, caller: &Caller, session: &str) -> Vec<String>

The input queued for the session, oldest first, as the person reads it: an app’s suggestion is its words and label. A message the session’s running turn holds is listed until the turn takes it.

Source

pub fn deliver_queued(&self, caller: &Caller, session: &str)

Looks at once whether the session’s queued input can be sent, after an answer recorded outside execute, such as a take over (spec 3.3 §7.4 rule 2). Queued input is sent without it too, once the session is free.

Source

pub fn can_add_agents(&self, caller: &Caller) -> bool

Whether the roster ends with New agent for caller (spec 3.3 §5.7).

Source

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

One agent caller added (spec 3.3 §5.7 “Agent settings”).

§Errors

surface.not_found when the caller has no such agent, or the source’s error.

Source

pub async fn agent_choices(&self, caller: &Caller) -> Result<AgentChoices>

What caller may choose for an agent.

§Errors

surface.not_here where agents are not changed, or the source’s error.

Source

pub async fn preview_agent( &self, caller: &Caller, request: AgentPreviewRequest, ) -> Result<AgentPreview>

Here is what Finance can do: the preview of request (spec 3.3 §5.7).

§Errors

surface.not_here where agents are not changed, or the kernel’s refusal.

Trait Implementations§

Source§

impl Clone for SurfaceEngine

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 SurfaceEngine

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for SurfaceEngine

§

impl !UnwindSafe for SurfaceEngine

§

impl Forget for SurfaceEngine

§

impl Freeze for SurfaceEngine
where *const ArcInner<Inner> is !null: Freeze, PhantomData<ArcInner<Inner>>: Freeze,

§

impl Move for SurfaceEngine

§

impl Send for SurfaceEngine
where Arc<Inner>: Send,

§

impl Sync for SurfaceEngine
where Arc<Inner>: Sync,

§

impl Unpin for SurfaceEngine
where Arc<Inner>: Unpin,

§

impl UnsafeUnpin for SurfaceEngine
where *const ArcInner<Inner> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner>>: 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> DynClone for T
where T: Clone,

Source§

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

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