pub struct SessionBuilder { /* private fields */ }Expand description
Builder for Session — the only construction path outside macp-core
(the struct is #[non_exhaustive]).
Defaults: state: Open, ttl_expiry: i64::MAX (never expires until set),
numeric fields 0, everything else empty/None.
Implementations§
Source§impl SessionBuilder
impl SessionBuilder
pub fn state(self, value: SessionState) -> SessionBuilder
pub fn ttl_expiry(self, value: i64) -> SessionBuilder
pub fn ttl_ms(self, value: i64) -> SessionBuilder
pub fn started_at_unix_ms(self, value: i64) -> SessionBuilder
pub fn resolution(self, value: Option<Vec<u8>>) -> SessionBuilder
pub fn mode_state(self, value: Vec<u8>) -> SessionBuilder
pub fn participants(self, value: Vec<String>) -> SessionBuilder
pub fn seen_message_ids(self, value: HashSet<String>) -> SessionBuilder
pub fn extensions(self, value: HashMap<String, Vec<u8>>) -> SessionBuilder
pub fn roots(self, value: Vec<Root>) -> SessionBuilder
pub fn participant_message_counts( self, value: HashMap<String, u32>, ) -> SessionBuilder
pub fn participant_last_seen( self, value: HashMap<String, i64>, ) -> SessionBuilder
pub fn policy_definition( self, value: Option<PolicyDefinition>, ) -> SessionBuilder
pub fn suspended_at_ms(self, value: Option<i64>) -> SessionBuilder
pub fn accumulated_suspended_ms(self, value: i64) -> SessionBuilder
pub fn semantics_rev(self, value: u32) -> SessionBuilder
Sourcepub fn max_suspend_ms(self, value: i64) -> SessionBuilder
pub fn max_suspend_ms(self, value: i64) -> SessionBuilder
Suspension cap bound at SessionStart; 0 = use the
MAX_SUSPEND_MS default (legacy sessions, library consumers).
pub fn intent(self, value: impl Into<String>) -> SessionBuilder
pub fn mode_version(self, value: impl Into<String>) -> SessionBuilder
pub fn configuration_version(self, value: impl Into<String>) -> SessionBuilder
pub fn policy_version(self, value: impl Into<String>) -> SessionBuilder
pub fn context_id(self, value: impl Into<String>) -> SessionBuilder
pub fn build(self) -> Session
Trait Implementations§
Source§impl Clone for SessionBuilder
impl Clone for SessionBuilder
Source§fn clone(&self) -> SessionBuilder
fn clone(&self) -> SessionBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionBuilder
impl RefUnwindSafe for SessionBuilder
impl Send for SessionBuilder
impl Sync for SessionBuilder
impl Unpin for SessionBuilder
impl UnsafeUnpin for SessionBuilder
impl UnwindSafe for SessionBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request