pub struct RemotesState { /* private fields */ }Expand description
Manages blit.remotes: reads/writes the file, watches for external
changes, and broadcasts the serialised contents to all subscribers.
The broadcast value is the raw file text (same as what read_remotes
would parse), sent as a single string so receivers can re-parse it.
The config WebSocket handler prefixes it with "remotes:".
Implementations§
Source§impl RemotesState
impl RemotesState
Sourcepub fn ephemeral(initial: String) -> Self
pub fn ephemeral(initial: String) -> Self
Ephemeral mode: starts with the given text, no file I/O, no watcher.
Used by blit open to advertise the session’s destinations to the
browser without touching blit.remotes.
Sourcepub fn set(&self, entries: &[(String, String)])
pub fn set(&self, entries: &[(String, String)])
Overwrite blit.remotes with entries and broadcast the change.
pub fn subscribe(&self) -> Receiver<String>
Trait Implementations§
Source§impl Clone for RemotesState
impl Clone for RemotesState
Source§fn clone(&self) -> RemotesState
fn clone(&self) -> RemotesState
Returns a duplicate of the value. Read more
1.0.0 · 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 RemotesState
impl RefUnwindSafe for RemotesState
impl Send for RemotesState
impl Sync for RemotesState
impl Unpin for RemotesState
impl UnsafeUnpin for RemotesState
impl UnwindSafe for RemotesState
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