Enum network_clique::protocols::Protocol  
source · pub enum Protocol {
    V1,
}Expand description
Defines the protocol for communication. Currently single variant, but left in case of protocol change.
Variants§
V1
The current version of the protocol, with pseudorandom connection direction and multiplexing.
Implementations§
source§impl Protocol
 
impl Protocol
sourceconst MIN_VERSION: u32 = 1u32
 
const MIN_VERSION: u32 = 1u32
Minimal supported protocol version.
sourceconst MAX_VERSION: u32 = 1u32
 
const MAX_VERSION: u32 = 1u32
Maximal supported protocol version.
sourcepub async fn manage_incoming<SK: SecretKey, D: Data, S: Splittable>(
    &self,
    stream: S,
    secret_key: SK,
    result_for_parent: UnboundedSender<(SK::PublicKey, Option<UnboundedSender<D>>)>,
    data_for_user: UnboundedSender<D>,
    authorization_requests_sender: UnboundedSender<(SK::PublicKey, Sender<bool>)>,
    metrics: Metrics
) -> Result<(), ProtocolError<SK::PublicKey>>
 
pub async fn manage_incoming<SK: SecretKey, D: Data, S: Splittable>( &self, stream: S, secret_key: SK, result_for_parent: UnboundedSender<(SK::PublicKey, Option<UnboundedSender<D>>)>, data_for_user: UnboundedSender<D>, authorization_requests_sender: UnboundedSender<(SK::PublicKey, Sender<bool>)>, metrics: Metrics ) -> Result<(), ProtocolError<SK::PublicKey>>
Launches the proper variant of the protocol (receiver half).
sourcepub async fn manage_outgoing<SK: SecretKey, D: Data, S: Splittable>(
    &self,
    stream: S,
    secret_key: SK,
    public_key: SK::PublicKey,
    result_for_service: UnboundedSender<(SK::PublicKey, Option<UnboundedSender<D>>)>,
    data_for_user: UnboundedSender<D>,
    metrics: Metrics
) -> Result<(), ProtocolError<SK::PublicKey>>
 
pub async fn manage_outgoing<SK: SecretKey, D: Data, S: Splittable>( &self, stream: S, secret_key: SK, public_key: SK::PublicKey, result_for_service: UnboundedSender<(SK::PublicKey, Option<UnboundedSender<D>>)>, data_for_user: UnboundedSender<D>, metrics: Metrics ) -> Result<(), ProtocolError<SK::PublicKey>>
Launches the proper variant of the protocol (sender half).
Trait Implementations§
source§impl PartialEq for Protocol
 
impl PartialEq for Protocol
impl Eq for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.