pub struct Sessions { /* private fields */ }Expand description
The session factory. Build it with Laser::sessions or
Laser::sessions_with.
Implementations§
Source§impl Sessions
impl Sessions
Sourcepub fn create(&self, label: impl Into<String>) -> SessionBuilder
pub fn create(&self, label: impl Into<String>) -> SessionBuilder
A session named label. Its id derives from the stream, the namespace,
and the label, so the same label reaches the same session.
Sourcepub fn start(&self) -> SessionBuilder
pub fn start(&self) -> SessionBuilder
A fresh session with a new id.
Sourcepub fn open(&self, conversation: ConversationId) -> Session
pub fn open(&self, conversation: ConversationId) -> Session
The session over an existing conversation, as a lens: no IO, no
lease, and no author until Session::as_agent names one.
Sourcepub fn config(&self) -> &SessionConfig
pub fn config(&self) -> &SessionConfig
This factory’s layout.
Sourcepub async fn bootstrap(
&self,
partitions: u32,
retention: TopicRetention,
) -> Result<SessionBootstrap, LaserError>
pub async fn bootstrap( &self, partitions: u32, retention: TopicRetention, ) -> Result<SessionBootstrap, LaserError>
Create the agent topics with Laser::bootstrap, then, when the
deployment serves sessions and SessionConfig::register_source is
on, register the stream as a session source. A refused registration
is logged and reported as registered: false, never an error, because
an account without session administration rights relies on
provisioning to register the stream.
Sourcepub async fn unregister(&self) -> Result<(), LaserError>
pub async fn unregister(&self) -> Result<(), LaserError>
Stop the deployment from indexing this stream’s sessions. The request
goes through the authenticated managed control path and needs session
administration rights on the stream. The index for the stream is
dropped once the control record folds. A later
bootstrap registers the stream again.
Sourcepub fn stream(&self) -> Result<&str, LaserError>
pub fn stream(&self) -> Result<&str, LaserError>
The stream the sessions ride.
Source§impl Sessions
impl Sessions
Sourcepub async fn get(&self, id: ConversationId) -> Result<SessionInfo, LaserError>
pub async fn get(&self, id: ConversationId) -> Result<SessionInfo, LaserError>
One session’s summary from the deployment’s session index.
Sourcepub fn list(&self) -> SessionListRequest
pub fn list(&self) -> SessionListRequest
A page of this stream’s sessions, newest first. Chain the filters and
finish with fetch.
Sourcepub fn events(&self, id: ConversationId) -> SessionEventsRequest
pub fn events(&self, id: ConversationId) -> SessionEventsRequest
A page of one session’s events in broker time order. Chain the paging
and finish with fetch.
Sourcepub async fn state(
&self,
id: ConversationId,
history_limit: u32,
) -> Result<SessionStateView, LaserError>
pub async fn state( &self, id: ConversationId, history_limit: u32, ) -> Result<SessionStateView, LaserError>
One session’s folded state document with up to history_limit history
rows. Zero leaves the history size to the server.
Sourcepub async fn links(
&self,
id: ConversationId,
surface: Option<LinkSurface>,
) -> Result<SessionLinksView, LaserError>
pub async fn links( &self, id: ConversationId, surface: Option<LinkSurface>, ) -> Result<SessionLinksView, LaserError>
The resources one session wrote, recalled, or touched, narrowed to
surface when given.
Sourcepub async fn sources(
&self,
id: ConversationId,
) -> Result<SessionSources, LaserError>
pub async fn sources( &self, id: ConversationId, ) -> Result<SessionSources, LaserError>
The source partitions that hold one session’s records.
Sourcepub async fn changes(
&self,
after: u64,
limit: u32,
) -> Result<SessionChanges, LaserError>
pub async fn changes( &self, after: u64, limit: u32, ) -> Result<SessionChanges, LaserError>
The change rows of this stream after after, up to limit. Zero
leaves the page size to the server.
Sourcepub async fn watch(
&self,
poll_every: Duration,
) -> Result<SessionWatch, LaserError>
pub async fn watch( &self, poll_every: Duration, ) -> Result<SessionWatch, LaserError>
Follow this stream’s session changes from now, polling every
poll_every and coalescing the changed session ids of each poll. The
watch starts at the change rows retained when this call returns, so a
change made after it is never missed.
Source§impl Sessions
impl Sessions
Sourcepub fn submit(
&self,
agent: impl Into<AgentId>,
input: impl Into<Vec<u8>>,
) -> SubmitBuilder
pub fn submit( &self, agent: impl Into<AgentId>, input: impl Into<Vec<u8>>, ) -> SubmitBuilder
Hand a new session to agent with input as its first command.
Sourcepub fn control(&self, stream: &str, id: ConversationId) -> SessionControl
pub fn control(&self, stream: &str, id: ConversationId) -> SessionControl
Operator control of the session id in stream.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sessions
impl !UnwindSafe for Sessions
impl Freeze for Sessions
impl Send for Sessions
impl Sync for Sessions
impl Unpin for Sessions
impl UnsafeUnpin for Sessions
Blanket Implementations§
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.