Skip to main content

Multicast

Struct Multicast 

Source
pub struct Multicast { /* private fields */ }
Expand description

UDP multicast adapter for LAN peer discovery and sync.

Broadcasts Gun protocol messages to the multicast group 233.255.255.255:7654 and receives messages from other peers on the same LAN. Messages exceeding the safe UDP datagram size are transparently chunked and reassembled.

Implementations§

Source§

impl Multicast

Source

pub fn new(config: Config) -> Self

Creates a new multicast adapter bound to the default group.

§Panics

Panics if the multicast socket cannot be created (e.g. no network interfaces available, or port 7654 is in use).

Trait Implementations§

Source§

impl Actor for Multicast

Source§

fn subscribe_to_everything(&self) -> bool

Returns true — multicast subscribes to all messages.

Source§

fn handle<'life0, 'life1, 'async_trait>( &'life0 mut self, msg: Arc<Message>, ctx: &'life1 ActorContext, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle an incoming message. Read more
Source§

fn pre_start<'life0, 'life1, 'async_trait>( &'life0 mut self, ctx: &'life1 ActorContext, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called once before the actor starts processing messages. Read more
Source§

fn stopping<'life0, 'life1, 'async_trait>( &'life0 mut self, _ctx: &'life1 ActorContext, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called once after the actor’s message loop exits. Read more
Source§

fn handle_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, batch: &'life1 mut Vec<Arc<Message>>, context: &'life2 ActorContext, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Handle a batch of messages drained from the mailbox. Read more
Source§

fn try_clone_storage(&self) -> Option<Box<dyn Actor>>

Attempts to produce a clone of this actor for storage read/write splitting. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V