pub struct LiveSource<S> { /* private fields */ }Expand description
A read-only handle to a channel’s root value, used to load it and to create views of it.
A source doesn’t keep the channel open. After the publisher drops, it still reads the final root.
Implementations§
Source§impl<S> LiveSource<S>
impl<S> LiveSource<S>
Source§impl<S> LiveSource<S>
impl<S> LiveSource<S>
Sourcepub fn live<T>(
&self,
project: impl for<'a> Fn(&'a S) -> &'a T + Send + Sync + 'static,
) -> Live<T>
pub fn live<T>( &self, project: impl for<'a> Fn(&'a S) -> &'a T + Send + Sync + 'static, ) -> Live<T>
Creates a view of the value selected by project, starting from the current root.
project borrows part of the root; the view clones that selected value into its snapshot. The view retains access
to the source and can outlive this handle.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for LiveSource<S>
impl<S> RefUnwindSafe for LiveSource<S>where
S: RefUnwindSafe,
impl<S> Send for LiveSource<S>
impl<S> Sync for LiveSource<S>
impl<S> Unpin for LiveSource<S>
impl<S> UnsafeUnpin for LiveSource<S>
impl<S> UnwindSafe for LiveSource<S>where
S: RefUnwindSafe,
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> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self> ⓘ
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self> ⓘ
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more