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) -> Self
pub fn ttl_expiry(self, value: i64) -> Self
pub fn ttl_ms(self, value: i64) -> Self
pub fn started_at_unix_ms(self, value: i64) -> Self
pub fn resolution(self, value: Option<Vec<u8>>) -> Self
pub fn mode_state(self, value: Vec<u8>) -> Self
pub fn participants(self, value: Vec<String>) -> Self
pub fn seen_message_ids(self, value: HashSet<String>) -> Self
pub fn extensions(self, value: HashMap<String, Vec<u8>>) -> Self
pub fn roots(self, value: Vec<Root>) -> Self
pub fn participant_message_counts(self, value: HashMap<String, u32>) -> Self
pub fn participant_last_seen(self, value: HashMap<String, i64>) -> Self
pub fn policy_definition(self, value: Option<PolicyDefinition>) -> Self
pub fn suspended_at_ms(self, value: Option<i64>) -> Self
pub fn accumulated_suspended_ms(self, value: i64) -> Self
pub fn semantics_rev(self, value: u32) -> Self
Sourcepub fn max_suspend_ms(self, value: i64) -> Self
pub fn max_suspend_ms(self, value: i64) -> Self
Suspension cap bound at SessionStart; 0 = use the
MAX_SUSPEND_MS default (legacy sessions, library consumers).
pub fn intent(self, value: impl Into<String>) -> Self
pub fn mode_version(self, value: impl Into<String>) -> Self
pub fn configuration_version(self, value: impl Into<String>) -> Self
pub fn policy_version(self, value: impl Into<String>) -> Self
pub fn context_id(self, value: impl Into<String>) -> Self
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