pub struct AppServerSession { /* private fields */ }Expand description
Session actor that owns an Agent and processes commands from the SQ.
Created via AppServerSession::new, which returns a SessionHandle
for the UI layer and the actor itself for spawning on a tokio task.
Implementations§
Source§impl AppServerSession
impl AppServerSession
Sourcepub fn new(agent: Agent, config: SessionConfig) -> (SessionHandle, Self)
pub fn new(agent: Agent, config: SessionConfig) -> (SessionHandle, Self)
Creates a new generation-zero session actor with the given agent and configuration.
Product composition roots that replace an Actor must call Self::set_generation
before spawning it. Returns a SessionHandle and the actor itself.
Sourcepub fn set_generation(&mut self, generation: u64)
pub fn set_generation(&mut self, generation: u64)
Assigns the authoritative generation before this Actor is spawned.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Returns the authoritative generation assigned by the composition root.
pub fn set_session_paths(&mut self, file: PathBuf, dir: PathBuf)
Sourcepub fn set_persistence(&mut self, session: Session, metadata: SessionMetadata)
pub fn set_persistence(&mut self, session: Session, metadata: SessionMetadata)
Assigns the durable session that owns successful turn-message writes.
Sourcepub fn set_durable_persistence(
&mut self,
session: DurableSession,
policy: PersistencePolicy,
)
pub fn set_durable_persistence( &mut self, session: DurableSession, policy: PersistencePolicy, )
Assigns an atomic durable session used by the embedded runtime.
Auto Trait Implementations§
impl !Freeze for AppServerSession
impl !RefUnwindSafe for AppServerSession
impl !UnwindSafe for AppServerSession
impl Send for AppServerSession
impl Sync for AppServerSession
impl Unpin for AppServerSession
impl UnsafeUnpin for AppServerSession
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
Mutably borrows from an owned value. Read more