[][src]Struct tdn_permission::CAPermissionedGroup

pub struct CAPermissionedGroup<P: Peer> { /* fields omitted */ }

Implementations

impl<P: Peer> CAPermissionedGroup<P>[src]

pub fn new(
    id: GroupId,
    my_pk: P::PublicKey,
    my_prove: P::Signature,
    ca: P::PublicKey
) -> Self
[src]

pub fn new_with_name(
    id: GroupId,
    my_pk: P::PublicKey,
    my_prove: P::Signature,
    ca: P::PublicKey,
    my_name: impl ToString
) -> Self
[src]

pub fn peers(&self) -> Vec<&PeerAddr>[src]

pub fn get_peer_addr(&self, name: &String) -> Option<&PeerAddr>[src]

pub fn add(
    &mut self,
    peer_addr: PeerAddr,
    pk: P::PublicKey,
    sign: P::Signature,
    addr: SocketAddr
)
[src]

directly add a peer to group.

pub fn join_bytes(&self) -> Vec<u8>[src]

pub fn sign_prove(
    sk: &P::SecretKey,
    pk: &P::PublicKey
) -> Result<P::Signature, Box<dyn Error>>
[src]

pub async fn join<'_>(
    &'_ mut self,
    peer_addr: PeerAddr,
    addr: SocketAddr,
    join_bytes: Vec<u8>,
    return_sender: Sender<SendMessage>
)
[src]

join: when peer join will call

pub fn join_result(
    &mut self,
    peer_addr: PeerAddr,
    is_ok: bool,
    _join_result: Vec<u8>
)
[src]

pub fn leave(&mut self, peer_addr: &PeerAddr)[src]

leave: when peer leave will call

Trait Implementations

impl<P: Debug + Peer> Debug for CAPermissionedGroup<P> where
    P::PublicKey: Debug,
    P::Signature: Debug,
    P::PublicKey: Debug,
    P::PublicKey: Debug,
    P::Signature: Debug
[src]

impl<P: Default + Peer> Default for CAPermissionedGroup<P> where
    P::PublicKey: Default,
    P::Signature: Default,
    P::PublicKey: Default,
    P::PublicKey: Default,
    P::Signature: Default
[src]

impl<P: Peer> Group for CAPermissionedGroup<P>[src]

type JoinType = (P::PublicKey, P::Signature)

define join_data's type.

type JoinResultType = ()

define join_result_data's type.

Auto Trait Implementations

impl<P> RefUnwindSafe for CAPermissionedGroup<P> where
    <P as Peer>::PublicKey: RefUnwindSafe,
    <P as Peer>::Signature: RefUnwindSafe

impl<P> Send for CAPermissionedGroup<P> where
    <P as Peer>::PublicKey: Send,
    <P as Peer>::Signature: Send

impl<P> Sync for CAPermissionedGroup<P> where
    <P as Peer>::PublicKey: Sync,
    <P as Peer>::Signature: Sync

impl<P> Unpin for CAPermissionedGroup<P> where
    <P as Peer>::PublicKey: Unpin,
    <P as Peer>::Signature: Unpin

impl<P> UnwindSafe for CAPermissionedGroup<P> where
    <P as Peer>::PublicKey: UnwindSafe,
    <P as Peer>::Signature: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.