[−][src]Struct rust_ipv8::community::CommunityRegistry
Every different kind of community is registered here with it's MID.
So that incoming messages can be distributed to the right communities. Makes use of a hashmap to achieve O(1) lookup time.
Methods
impl CommunityRegistry
[src]
pub fn add_community(
&mut self,
item: Box<dyn Community>
) -> Result<(), Box<dyn Error>>
[src]
&mut self,
item: Box<dyn Community>
) -> Result<(), Box<dyn Error>>
Adds a community to the registry.
pub fn forward_message(
&self,
packet: Packet,
address: Address
) -> Result<(), Box<dyn Error>>
[src]
&self,
packet: Packet,
address: Address
) -> Result<(), Box<dyn Error>>
Forwards the message to the corresponding community
Trait Implementations
impl Default for CommunityRegistry
[src]
fn default() -> Self
[src]
Returns a new community registry with all the built-in communities already registered. All custom communities can be added with the add_community method.
Auto Trait Implementations
impl Unpin for CommunityRegistry
impl !Sync for CommunityRegistry
impl !Send for CommunityRegistry
impl !RefUnwindSafe for CommunityRegistry
impl !UnwindSafe for CommunityRegistry
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,