pub enum Sub<M> {
None,
Tick {
id: u64,
every: Duration,
},
Stream {
id: u64,
name: &'static str,
},
WebSocket {
id: u64,
url: &'static str,
},
MapMsg {
inner: Box<Sub<()>>,
map: fn(()) -> M,
},
Batch(Vec<Sub<M>>),
}Expand description
Subscription descriptions — interpreted in runtime.rs.
Variants§
Implementations§
Source§impl<M> Sub<M>
impl<M> Sub<M>
pub fn none() -> Self
pub fn tick(id: u64, every: Duration) -> Self
pub fn stream(id: u64, name: &'static str) -> Self
pub fn websocket(id: u64, url: &'static str) -> Self
pub fn map<N>(self, map: fn(M) -> N) -> Sub<N>
pub fn batch(subs: impl IntoIterator<Item = Sub<M>>) -> Self
pub fn id(&self) -> Option<u64>
Trait Implementations§
impl<M: Eq> Eq for Sub<M>
impl<M> StructuralPartialEq for Sub<M>
Auto Trait Implementations§
impl<M> Freeze for Sub<M>
impl<M> RefUnwindSafe for Sub<M>
impl<M> Send for Sub<M>
impl<M> Sync for Sub<M>
impl<M> Unpin for Sub<M>
impl<M> UnsafeUnpin for Sub<M>
impl<M> UnwindSafe for Sub<M>
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