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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Clan
impl<'de> Deserialize<'de> for Clan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Clan
impl StructuralPartialEq for Clan
Auto Trait Implementations§
impl Freeze for Clan
impl RefUnwindSafe for Clan
impl Send for Clan
impl Sync for Clan
impl Unpin for Clan
impl UnsafeUnpin for Clan
impl UnwindSafe for Clan
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.