pub struct ExpressionTreeServer { /* private fields */ }Expand description
Authoritative bounded expression-tree session server.
Implementations§
Source§impl ExpressionTreeServer
impl ExpressionTreeServer
Sourcepub fn new(
address: ServerAddress,
codecs: Vec<Symbol>,
clock: Arc<dyn WallClock>,
limits: ExpressionTreeServerLimits,
) -> Result<Self, ExpressionTreeServerError>
pub fn new( address: ServerAddress, codecs: Vec<Symbol>, clock: Arc<dyn WallClock>, limits: ExpressionTreeServerLimits, ) -> Result<Self, ExpressionTreeServerError>
Creates a server with explicit address, codecs, wall clock, and hard lifecycle limits.
Sourcepub fn local() -> Self
pub fn local() -> Self
Creates a local server using the system wall clock and binary server frames.
Sourcepub fn address(&self) -> &ServerAddress
pub fn address(&self) -> &ServerAddress
Returns the configured server address.
Sourcepub const fn limits(&self) -> ExpressionTreeServerLimits
pub const fn limits(&self) -> ExpressionTreeServerLimits
Returns the configured lifecycle limits.
Sourcepub fn create_session(
&self,
cx: &mut Cx,
storage_name: &str,
) -> Result<SessionId, ExpressionTreeServerError>
pub fn create_session( &self, cx: &mut Cx, storage_name: &str, ) -> Result<SessionId, ExpressionTreeServerError>
Creates one authoritative session, capturing the creator’s runtime and immutable authority ceiling in the underlying expression tree.
Sourcepub fn snapshot(
&self,
session: &SessionId,
) -> Result<Expr, ExpressionTreeServerError>
pub fn snapshot( &self, session: &SessionId, ) -> Result<Expr, ExpressionTreeServerError>
Returns the current bounded snapshot for a session.
Sourcepub fn revision(
&self,
session: &SessionId,
) -> Result<u64, ExpressionTreeServerError>
pub fn revision( &self, session: &SessionId, ) -> Result<u64, ExpressionTreeServerError>
Returns the current optimistic revision.
Sourcepub fn apply_intent(
&self,
cx: &mut Cx,
session: &SessionId,
expected_revision: u64,
intent: &Expr,
) -> Result<Expr, ExpressionTreeServerError>
pub fn apply_intent( &self, cx: &mut Cx, session: &SessionId, expected_revision: u64, intent: &Expr, ) -> Result<Expr, ExpressionTreeServerError>
Decodes and commits one standard Intent through the existing
expression-tree SurfaceCodec.
Sourcepub fn close_session(
&self,
session: &SessionId,
) -> Result<bool, ExpressionTreeServerError>
pub fn close_session( &self, session: &SessionId, ) -> Result<bool, ExpressionTreeServerError>
Closes and removes one authoritative session.
Sourcepub fn subscribe(
&self,
session: &SessionId,
) -> Result<WatchId, ExpressionTreeServerError>
pub fn subscribe( &self, session: &SessionId, ) -> Result<WatchId, ExpressionTreeServerError>
Subscribes one bounded independent watch.
Sourcepub fn poll_watch(
&self,
session: &SessionId,
watch: &WatchId,
limit: usize,
) -> Result<WatchBatch, ExpressionTreeServerError>
pub fn poll_watch( &self, session: &SessionId, watch: &WatchId, limit: usize, ) -> Result<WatchBatch, ExpressionTreeServerError>
Drains at most limit changes from one watch.
Sourcepub fn cancel_watch(
&self,
session: &SessionId,
watch: &WatchId,
) -> Result<(), ExpressionTreeServerError>
pub fn cancel_watch( &self, session: &SessionId, watch: &WatchId, ) -> Result<(), ExpressionTreeServerError>
Cancels a watch idempotently with respect to future event delivery.
Sourcepub fn maintenance_tick(
&self,
steps: u64,
) -> Result<usize, ExpressionTreeServerError>
pub fn maintenance_tick( &self, steps: u64, ) -> Result<usize, ExpressionTreeServerError>
Advances the server’s mandatory logical lifecycle clock and expires idle sessions. No wall-clock value participates in the comparison.
Trait Implementations§
Source§impl Default for ExpressionTreeServer
impl Default for ExpressionTreeServer
Source§impl EvalFabric for ExpressionTreeServer
impl EvalFabric for ExpressionTreeServer
Source§impl EvalSite for ExpressionTreeServer
impl EvalSite for ExpressionTreeServer
Source§fn address(&self) -> &ServerAddress
fn address(&self) -> &ServerAddress
Source§fn answer(&self, cx: &mut Cx, frame: ServerFrame) -> Result<ServerFrame>
fn answer(&self, cx: &mut Cx, frame: ServerFrame) -> Result<ServerFrame>
frame, returning the reply frame.Source§fn answer_with_timeout(
&self,
cx: &mut Cx,
frame: ServerFrame,
timeout: Option<Duration>,
) -> Result<ServerFrame>
fn answer_with_timeout( &self, cx: &mut Cx, frame: ServerFrame, timeout: Option<Duration>, ) -> Result<ServerFrame>
frame with an optional deadline. Defaults to EvalSite::answer.Source§fn as_eval_fabric(&self) -> Option<&dyn EvalFabric>
fn as_eval_fabric(&self) -> Option<&dyn EvalFabric>
EvalFabric when it backs one. Defaults to None.Source§fn close_connection(&self, _cx: &mut Cx) -> Result<(), Error>
fn close_connection(&self, _cx: &mut Cx) -> Result<(), Error>
Source§fn stream(
&self,
cx: &mut Cx,
frame: ServerFrame,
sink: &mut dyn StreamSink,
) -> Result<(), Error>
fn stream( &self, cx: &mut Cx, frame: ServerFrame, sink: &mut dyn StreamSink, ) -> Result<(), Error>
frame into sink. The default path answers once
and emits a single chunk followed by end.Source§impl Object for ExpressionTreeServer
impl Object for ExpressionTreeServer
Source§fn display(&self, _cx: &mut Cx) -> Result<String>
fn display(&self, _cx: &mut Cx) -> Result<String>
Source§fn header(&self) -> &ObjectHeader
fn header(&self) -> &ObjectHeader
Source§fn op(&self, _key: &OpKey) -> Option<&dyn Op>
fn op(&self, _key: &OpKey) -> Option<&dyn Op>
key, if any.