diff --git a/nomos-da/network/subnetworks-assignations/src/lib.rs b/nomos-da/network/subnetworks-assignations/src/lib.rs index dbb71575..40ef9743 100644 --- a/nomos-da/network/subnetworks-assignations/src/lib.rs +++ b/nomos-da/network/subnetworks-assignations/src/lib.rs @@ -4,25 +4,25 @@ use std::collections::HashSet; use std::hash::Hash; pub trait MembershipHandler { - // Subnetworks Id type + /// Subnetworks Id type type NetworkId: Eq + Hash; - - // Members Id type + /// Members Id type type Id; - // Returns the set of NetworksIds an id is a member of + /// Returns the set of NetworksIds an id is a member of fn membership(&self, id: &Self::Id) -> HashSet; - // True if the id is a member of a network_id, False otherwise + /// True if the id is a member of a network_id, False otherwise fn is_member_of(&self, id: &Self::Id, network_id: &Self::NetworkId) -> bool { self.membership(id).contains(network_id) } - // Returns true if the member id is in the overall membership set + /// Returns true if the member id is in the overall membership set fn is_allowed(&self, id: &Self::Id) -> bool; - // Returns the set of members in a subnetwork by its NetworkId + /// Returns the set of members in a subnetwork by its NetworkId fn members_of(&self, network_id: &Self::NetworkId) -> HashSet; + /// Returns the set of all members fn members(&self) -> HashSet; }