pub struct ModulePeerData(/* private fields */);Expand description
A struct containing data of a peer for multiple signaling modules, each associated with the module’s namespace.
Implementations§
Source§impl ModulePeerData
impl ModulePeerData
Sourcepub fn new() -> ModulePeerData
pub fn new() -> ModulePeerData
Create a new empty ModulePeerData.
Sourcepub fn get<T>(&self) -> Result<Option<T>, Error>where
T: SignalingModulePeerFrontendData,
pub fn get<T>(&self) -> Result<Option<T>, Error>where
T: SignalingModulePeerFrontendData,
Get the peer frontend data for a specific module
Sourcepub fn insert<T>(&mut self, data: &T) -> Result<(), Error>where
T: SignalingModulePeerFrontendData,
pub fn insert<T>(&mut self, data: &T) -> Result<(), Error>where
T: SignalingModulePeerFrontendData,
Set the peer frontend data for a specific module
If an entry with the namespace already exists, it will be overwritten.
If the namespace of T is None, the data will not be stored at all.
Sourcepub fn update<T, F>(&mut self, update: F) -> Result<Option<T>, Error>
pub fn update<T, F>(&mut self, update: F) -> Result<Option<T>, Error>
Updates the module data and returns the new data
Sourcepub fn contains_key(&self, key: &ModuleId) -> bool
pub fn contains_key(&self, key: &ModuleId) -> bool
Query whether the module data contains a value for this key
Sourcepub fn remove<T>(&mut self)where
T: SignalingModulePeerFrontendData,
pub fn remove<T>(&mut self)where
T: SignalingModulePeerFrontendData,
Remove an entry by the namespace of SignalingModulePeerFrontendData type.
This method does not verify that the data actually can be deserialized into the requested types, it just uses its namespace and removes an entry with that namespace if it exists.
Sourcepub fn remove_key(&mut self, key: &ModuleId)
pub fn remove_key(&mut self, key: &ModuleId)
Remove an entry by its key if it exists.
Trait Implementations§
Source§impl Clone for ModulePeerData
impl Clone for ModulePeerData
Source§fn clone(&self) -> ModulePeerData
fn clone(&self) -> ModulePeerData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModulePeerData
impl Debug for ModulePeerData
Source§impl Default for ModulePeerData
impl Default for ModulePeerData
Source§fn default() -> ModulePeerData
fn default() -> ModulePeerData
Source§impl<'de> Deserialize<'de> for ModulePeerData
impl<'de> Deserialize<'de> for ModulePeerData
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModulePeerData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModulePeerData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ModulePeerData
impl Serialize for ModulePeerData
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ModulePeerData
impl RefUnwindSafe for ModulePeerData
impl Send for ModulePeerData
impl Sync for ModulePeerData
impl Unpin for ModulePeerData
impl UnsafeUnpin for ModulePeerData
impl UnwindSafe for ModulePeerData
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more