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
impl SurfaceEngine
Sourcepub async fn cameras_view(&self, caller: &Caller) -> Result<CamerasView>
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.
Sourcepub async fn camera_view(
&self,
caller: &Caller,
camera: &str,
) -> Result<CameraView>
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.
Sourcepub async fn freeze_camera_frame(
&self,
caller: &Caller,
camera: &str,
frame: &str,
) -> Result<StageView>
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.
Sourcepub async fn camera_frame(
&self,
caller: &Caller,
camera: &str,
digest: &str,
) -> Result<EvidenceBytes>
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.
Sourcepub async fn switch_camera(
&self,
caller: &Caller,
camera: &str,
on: bool,
) -> Result<CameraView>
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.
Sourcepub async fn stop_camera(
&self,
caller: &Caller,
camera: &str,
) -> Result<CameraView>
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.
Sourcepub async fn send_camera_frame(
&self,
caller: &Caller,
camera: &str,
mime_type: &str,
bytes: Vec<u8>,
) -> Result<FrameTaken>
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.
Sourcepub async fn retry_camera(
&self,
caller: &Caller,
camera: &str,
) -> Result<CameraView>
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.
Sourcepub async fn save_camera_zone(
&self,
caller: &Caller,
camera: &str,
zone: &str,
change: &ZoneChange,
) -> Result<ZoneSaved>
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.
Sourcepub async fn raise_camera_card(
&self,
caller: &Caller,
camera: &str,
card: &RaiseCard,
) -> Result<CardRaised>
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
impl SurfaceEngine
Sourcepub fn builder(source: Arc<dyn Source>) -> SurfaceEngineBuilder
pub fn builder(source: Arc<dyn Source>) -> SurfaceEngineBuilder
A builder over source.
Sourcepub fn camera_hub(&self) -> Option<&Cameras>
pub fn camera_hub(&self) -> Option<&Cameras>
The cameras of the live camera surface, when the engine serves them (spec 3.7 §8.2).
Sourcepub fn granted(&self) -> &[GrantedUse]
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());Sourcepub fn catalogs(&self) -> &Catalogs
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).
Sourcepub async fn decisions(&self, caller: &Caller) -> Result<Vec<DecisionCard>>
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.
Sourcepub async fn session_decisions(
&self,
caller: &Caller,
session: &str,
) -> Result<Vec<DecisionCard>>
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.
Sourcepub async fn decision(&self, caller: &Caller, id: &str) -> Result<DecisionCard>
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.
Sourcepub async fn decided_since(
&self,
caller: &Caller,
since: DateTime<Utc>,
) -> Result<Vec<DecisionCard>>
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.
Sourcepub async fn evidence_image(
&self,
caller: &Caller,
id: &str,
index: usize,
) -> Result<EvidenceBytes>
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.
Sourcepub async fn viewer(
&self,
caller: &Caller,
session: &str,
image: &str,
answer: Option<&str>,
compare: Option<&str>,
) -> Result<ViewerView>
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.
Sourcepub async fn viewer_image(
&self,
caller: &Caller,
session: &str,
image: &str,
) -> Result<EvidenceBytes>
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.
Sourcepub async fn viewer_export(
&self,
caller: &Caller,
session: &str,
answer: &str,
with: Option<&str>,
) -> Result<Value>
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.
Sourcepub async fn save_example(
&self,
caller: &Caller,
session: &str,
example: &LabelledExample,
) -> Result<SavedExample>
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.
Sourcepub async fn thread(
&self,
caller: &Caller,
session: &str,
) -> Result<Vec<FeedEntry>>
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.
Sourcepub fn feed(
&self,
caller: Caller,
session: String,
after: Option<u64>,
) -> BoxStream<'static, Result<FeedFrame>>
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.
Sourcepub async fn answers_since(
&self,
caller: &Caller,
since: DateTime<Utc>,
) -> Result<AnswerSummary>
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.
Sourcepub async fn agent_threads(
&self,
caller: &Caller,
agent: &str,
) -> Result<AgentThreads>
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.
Sourcepub async fn removed_agents(&self, caller: &Caller) -> Result<Vec<RemovedAgent>>
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.
Sourcepub async fn agent_details(&self, caller: &Caller) -> Result<Vec<AgentDetail>>
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.
Sourcepub fn primary_agent(&self) -> Option<AgentRef>
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).
Sourcepub async fn status(
&self,
caller: &Caller,
session: Option<&str>,
) -> Result<StatusLine>
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.
Sourcepub fn serve(&self, part: Served)
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]);Sourcepub fn serves(&self) -> Vec<Served>
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.
Sourcepub async fn briefing(
&self,
caller: &Caller,
since: DateTime<Utc>,
) -> Result<Briefing>
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.
Sourcepub async fn execute(
&self,
caller: &Caller,
command: Command,
) -> Result<CommandOutcome>
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
| Code | When |
|---|---|
surface.not_found | No 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_allowed | The surface may not give this answer (§7.2) |
surface.confirm_presence | A high-risk approval without confirming it is you |
surface.call_not_expanded | A truncated call approved before it was expanded |
surface.not_here | An agent answering or steering, resuming outside the home, loosening the mode from chat or voice, a Steer while everything is stopped |
surface.operator_only | Stop all or Resume all from a caller outside the group stops_need names |
surface.invalid | A spoken answer: it goes through decide_spoken with its transcript (feature voice) |
surface.unsupported | The source cannot do it |
| the source’s code | The source failed |
Sourcepub async fn decide_spoken(
&self,
caller: &Caller,
decision_id: &str,
version: u64,
answer: Answer,
transcript: &str,
) -> Result<SpokenAnswer>
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}");
}Sourcepub fn unqueue_last(&self, caller: &Caller, session: &str) -> Option<String>
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.
Sourcepub fn queued(&self, caller: &Caller, session: &str) -> Vec<String>
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.
Sourcepub fn deliver_queued(&self, caller: &Caller, session: &str)
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.
Sourcepub fn can_add_agents(&self, caller: &Caller) -> bool
pub fn can_add_agents(&self, caller: &Caller) -> bool
Whether the roster ends with New agent for caller (spec 3.3 §5.7).
Sourcepub async fn agent(&self, caller: &Caller, id: &str) -> Result<AgentDetail>
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.
Sourcepub async fn agent_choices(&self, caller: &Caller) -> Result<AgentChoices>
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.
Sourcepub async fn preview_agent(
&self,
caller: &Caller,
request: AgentPreviewRequest,
) -> Result<AgentPreview>
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
impl Clone for SurfaceEngine
Auto Trait Implementations§
impl !RefUnwindSafe for SurfaceEngine
impl !UnwindSafe for SurfaceEngine
impl Forget for SurfaceEngine
impl Freeze for SurfaceEngine
impl Move for SurfaceEngine
impl Send for SurfaceEngine
impl Sync for SurfaceEngine
impl Unpin for SurfaceEngine
impl UnsafeUnpin for SurfaceEngine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more