Struct node_filter::NodeFilter
source · [−]pub struct NodeFilter { /* private fields */ }
Expand description
Connection filter that uses a contract to manage permissions.
Implementations
sourceimpl NodeFilter
impl NodeFilter
sourcepub fn new(
client: Weak<dyn BlockChainClient>,
contract_address: Address
) -> NodeFilter
pub fn new(
client: Weak<dyn BlockChainClient>,
contract_address: Address
) -> NodeFilter
Create a new instance. Accepts a contract address.
Trait Implementations
sourceimpl ConnectionFilter for NodeFilter
impl ConnectionFilter for NodeFilter
sourcefn connection_allowed(
&self,
own_id: &NodeId,
connecting_id: &NodeId,
_direction: ConnectionDirection
) -> bool
fn connection_allowed(
&self,
own_id: &NodeId,
connecting_id: &NodeId,
_direction: ConnectionDirection
) -> bool
Filter a connection. Returns true
if connection should be allowed. false
if rejected.
Auto Trait Implementations
impl !RefUnwindSafe for NodeFilter
impl Send for NodeFilter
impl Sync for NodeFilter
impl Unpin for NodeFilter
impl !UnwindSafe for NodeFilter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more