pub struct TopicInterpreter<T> {
pub event_name: String,
pub interpret: fn(&Value) -> Result<T, WsError>,
}Fields§
§event_name: StringOnly one interpreter for this name is allowed to exist // enforced through Hash impl defined over event_name only
interpret: fn(&Value) -> Result<T, WsError>When name matches, interpretation should succeed.
Trait Implementations§
Source§impl<T: Clone> Clone for TopicInterpreter<T>
impl<T: Clone> Clone for TopicInterpreter<T>
Source§fn clone(&self) -> TopicInterpreter<T>
fn clone(&self) -> TopicInterpreter<T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for TopicInterpreter<T>
impl<T: Debug> Debug for TopicInterpreter<T>
Source§impl<T> Hash for TopicInterpreter<T>
impl<T> Hash for TopicInterpreter<T>
Source§impl<T> PartialEq for TopicInterpreter<T>
impl<T> PartialEq for TopicInterpreter<T>
impl<T: Eq> Eq for TopicInterpreter<T>
Auto Trait Implementations§
impl<T> Freeze for TopicInterpreter<T>
impl<T> RefUnwindSafe for TopicInterpreter<T>
impl<T> Send for TopicInterpreter<T>
impl<T> Sync for TopicInterpreter<T>
impl<T> Unpin for TopicInterpreter<T>
impl<T> UnwindSafe for TopicInterpreter<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.