pub struct ReplicationView { /* private fields */ }Expand description
A slot serve fills once the replicator exists.
Cloneable and cheap: every surface holds the same Arc, and the closure is
set exactly once. Reading before it is set answers “nothing configured”,
which is what a server with no replication is.
Implementations§
Source§impl ReplicationView
impl ReplicationView
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty view. Reads as “nothing configured” until Self::fill.
Sourcepub fn fill(
&self,
source: impl Fn() -> ReplicationReport + Send + Sync + 'static,
)
pub fn fill( &self, source: impl Fn() -> ReplicationReport + Send + Sync + 'static, )
Fill it. The second call is ignored: one server has one replicator, and silently replacing the source would make which one is being read depend on start-up order.
Sourcepub fn report(&self) -> ReplicationReport
pub fn report(&self) -> ReplicationReport
The snapshot, now.
Trait Implementations§
Source§impl Clone for ReplicationView
impl Clone for ReplicationView
Source§impl Debug for ReplicationView
impl Debug for ReplicationView
Auto Trait Implementations§
impl !RefUnwindSafe for ReplicationView
impl !UnwindSafe for ReplicationView
impl Freeze for ReplicationView
impl Send for ReplicationView
impl Sync for ReplicationView
impl Unpin for ReplicationView
impl UnsafeUnpin for ReplicationView
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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