pub struct ConsensusContext<P: ConsensusPlugin> { /* private fields */ }Implementations§
Source§impl<P: ConsensusPlugin> ConsensusContext<P>
impl<P: ConsensusPlugin> ConsensusContext<P>
Sourcepub fn new(signer: P::Signer) -> Self
pub fn new(signer: P::Signer) -> Self
Build a fresh context. P::new_storage creates the shared backing
once; signer is supplied by the integrator (typically wraps the
user’s wallet / account key).
Sourcepub fn build_service(&self) -> PluginConsensus<P>
pub fn build_service(&self) -> PluginConsensus<P>
Build a fresh per-conversation ConsensusService. Clones the shared
storage handle so all per-conv services share one underlying
persistence (scope-keyed); clones the signer; mints a fresh private
event bus.
Sourcepub async fn delete_scope(&self, scope: &P::Scope) -> Result<(), ConsensusError>
pub async fn delete_scope(&self, scope: &P::Scope) -> Result<(), ConsensusError>
Drop a conversation’s scope from the shared consensus storage. Called on conversation leave.
Trait Implementations§
Source§impl<P: ConsensusPlugin> Clone for ConsensusContext<P>
impl<P: ConsensusPlugin> Clone for ConsensusContext<P>
Auto Trait Implementations§
impl<P> Freeze for ConsensusContext<P>
impl<P> RefUnwindSafe for ConsensusContext<P>where
<P as ConsensusPlugin>::ConsensusStorage: RefUnwindSafe,
<P as ConsensusPlugin>::Signer: RefUnwindSafe,
impl<P> Send for ConsensusContext<P>
impl<P> Sync for ConsensusContext<P>
impl<P> Unpin for ConsensusContext<P>
impl<P> UnsafeUnpin for ConsensusContext<P>where
<P as ConsensusPlugin>::ConsensusStorage: UnsafeUnpin,
<P as ConsensusPlugin>::Signer: UnsafeUnpin,
impl<P> UnwindSafe for ConsensusContext<P>where
<P as ConsensusPlugin>::ConsensusStorage: UnwindSafe,
<P as ConsensusPlugin>::Signer: UnwindSafe,
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> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more