pub struct Clan {
pub name: String,
pub created_by: String,
pub created_at: UnixMillis,
pub members: Vec<ClanMember>,
pub invites: Vec<ClanInvite>,
pub offers: Vec<ClanRepoOffer>,
}Expand description
A clan, as the identity table holds it, keyed by its name — which is also its namespace.
Fields§
§name: StringThe clan’s name = its namespace.
created_by: StringThe account that created it (its first admin).
created_at: UnixMillisWhen.
members: Vec<ClanMember>Its members, admins included, in the order they joined.
invites: Vec<ClanInvite>Accounts invited and not yet answered.
offers: Vec<ClanRepoOffer>Repositories offered out of the clan, not yet answered (round 2).
Implementations§
Source§impl Clan
impl Clan
Sourcepub fn room_bytes(&self) -> u64
pub fn room_bytes(&self) -> u64
The clan’s room: the sum of its members’ contributions.
Sourcepub fn member(&self, principal: &str) -> Option<&ClanMember>
pub fn member(&self, principal: &str) -> Option<&ClanMember>
The member row of principal, if it is one.
Sourcepub fn role_of(&self, principal: &str) -> Option<ClanRole>
pub fn role_of(&self, principal: &str) -> Option<ClanRole>
Where principal stands in this clan.
Sourcepub fn floor_for(&self, member: &str, used: u64) -> u64
pub fn floor_for(&self, member: &str, used: u64) -> u64
How low member‘s contribution may go while the clan stores
used: what the clan stores, less what the others give. 0 when the
others’ contributions cover it.
Sourcepub fn floor_in_force(&self, member: &str, used: u64, lapsed: &[String]) -> u64
pub fn floor_in_force(&self, member: &str, used: u64, lapsed: &[String]) -> u64
Clan::floor_for with the shares of lapsed members not counted
(round 2: a member whose paid period has ended gives the clan nothing
the door counts). A lapsed member’s own share is already out of force,
so its floor is 0.
Sourcepub fn room_in_force(&self, lapsed: &[String]) -> u64
pub fn room_in_force(&self, lapsed: &[String]) -> u64
The room in force: the sum of the shares of members not in
lapsed.
Sourcepub fn offer_of(&self, repo: &str) -> Option<&ClanRepoOffer>
pub fn offer_of(&self, repo: &str) -> Option<&ClanRepoOffer>
The open offer of repo, if any.