pub struct OrgMembership {
pub org_id: Uuid,
pub role: Option<String>,
pub roles: Vec<String>,
}Expand description
A user’s membership in one organisation, and the roles they hold there.
Fields§
§org_id: Uuid§role: Option<String>The member’s primary role, from membership.role. Kept as its own
field because that is the column apps and hook contexts already read.
roles: Vec<String>Every role held here, primary included — one entry per role, in the order the database returned them.
Implementations§
Source§impl OrgMembership
impl OrgMembership
Sourcepub fn new(
org_id: Uuid,
role: Option<String>,
extra: impl IntoIterator<Item = String>,
) -> Self
pub fn new( org_id: Uuid, role: Option<String>, extra: impl IntoIterator<Item = String>, ) -> Self
Build a membership from its primary role and any additional ones,
keeping roles a set with the primary first.
Trait Implementations§
Source§impl Clone for OrgMembership
impl Clone for OrgMembership
Source§fn clone(&self) -> OrgMembership
fn clone(&self) -> OrgMembership
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OrgMembership
impl Debug for OrgMembership
Source§impl Default for OrgMembership
impl Default for OrgMembership
Source§fn default() -> OrgMembership
fn default() -> OrgMembership
Returns the “default value” for a type. Read more
impl Eq for OrgMembership
Source§impl PartialEq for OrgMembership
impl PartialEq for OrgMembership
impl StructuralPartialEq for OrgMembership
Auto Trait Implementations§
impl Freeze for OrgMembership
impl RefUnwindSafe for OrgMembership
impl Send for OrgMembership
impl Sync for OrgMembership
impl Unpin for OrgMembership
impl UnsafeUnpin for OrgMembership
impl UnwindSafe for OrgMembership
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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,
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
Compare self to
key and return true if they are equal.