[][src]Struct rust_ipv8::community::CommunityRegistry

pub struct CommunityRegistry { /* fields omitted */ }

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]

Adds a community to the registry.

pub fn forward_message(
    &self,
    packet: Packet,
    address: Address
) -> Result<(), Box<dyn Error>>
[src]

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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]