[−][src]Enum chamomile_types::message::SendMessage
main send message for outside channel, send from outside to chamomile.
Variants
(permissioned only) when peer request for join, outside decide connect or not.
params is peer_id
, is_connect
, is_force_close
, result info
.
if is_connect
is true, it will add to white directly list.
we want to build a better network, add a is_force_close
.
if is_connect
is false, but is_force_close
if true, we
will use this peer to build our DHT for better connection.
if false, we will force close it.
PeerConnect(PeerId, Option<SocketAddr>, Vec<u8>)
when need add a peer to stable connect, send to chamomile from outside.
if success connect, will start a stable connection, and add peer to kad, stables,
bootstraps and whitelists. if failure, will send PeerLeave
to outside.
params is peer_id
, socket_addr
and peer join_info
.
PeerDisconnect(PeerId)
when outside want to close a stable connectioned peer. use it force close.
params is peer_id
.
Connect(SocketAddr, Option<Vec<u8>>)
when outside want to connect a peer. will try connect directly.
if connected, chamomile will add to kad and bootstrap. if join_info is none,
chamomile will use config's join_data as default.
params is socket_addr
, join_info
.
DisConnect(SocketAddr)
when outside donnot want to connect peer. use it to force close.
it will remove from kad and bootstrap list.
params is socket_addr
.
when need send a data to a peer, only need know the peer_id,
the chamomile will help you send data to there.
params is peer_id
and data_bytes
.
when need broadcast a data to all network, chamomile support some
common algorithm, use it, donnot worry.
params is broadcast_type
and data_bytes
Stream(u32, StreamType)
Apply for build a stream between nodes.
params is u32
stream symbol, and StreamType
.
Trait Implementations
impl Clone for SendMessage
[src]
fn clone(&self) -> SendMessage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SendMessage
[src]
impl Eq for SendMessage
[src]
impl PartialEq<SendMessage> for SendMessage
[src]
fn eq(&self, other: &SendMessage) -> bool
[src]
fn ne(&self, other: &SendMessage) -> bool
[src]
impl StructuralEq for SendMessage
[src]
impl StructuralPartialEq for SendMessage
[src]
Auto Trait Implementations
impl RefUnwindSafe for SendMessage
impl Send for SendMessage
impl Sync for SendMessage
impl Unpin for SendMessage
impl UnwindSafe for SendMessage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,