pub struct Collaborator {
pub id: u64,
pub repo_key: String,
pub user: String,
pub permission: Permission,
pub added_by: String,
pub created_at: u64,
pub updated_at: u64,
}Expand description
A collaborator on a repository.
Collaborators are users who have been explicitly granted access to a repository, separate from organization membership or team access.
Fields§
§id: u64Unique collaborator ID.
repo_key: StringRepository key (e.g., “owner/repo”).
user: StringUser’s public key (hex-encoded).
permission: PermissionPermission level granted.
added_by: StringWho added this collaborator (public key).
created_at: u64When the collaborator was added (Unix timestamp).
updated_at: u64When the permission was last updated (Unix timestamp).
Implementations§
Source§impl Collaborator
impl Collaborator
Sourcepub fn new(
id: u64,
repo_key: String,
user: String,
permission: Permission,
added_by: String,
) -> Self
pub fn new( id: u64, repo_key: String, user: String, permission: Permission, added_by: String, ) -> Self
Create a new collaborator.
Sourcepub fn has_permission(&self, required: Permission) -> bool
pub fn has_permission(&self, required: Permission) -> bool
Check if this collaborator has at least the required permission.
Sourcepub fn set_permission(&mut self, permission: Permission)
pub fn set_permission(&mut self, permission: Permission)
Update the permission level.
Trait Implementations§
Source§impl Clone for Collaborator
impl Clone for Collaborator
Source§fn clone(&self) -> Collaborator
fn clone(&self) -> Collaborator
Returns a duplicate of the value. Read more
1.0.0 · 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 Collaborator
impl Debug for Collaborator
Source§impl<'de> Deserialize<'de> for Collaborator
impl<'de> Deserialize<'de> for Collaborator
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Collaborator> for CollaboratorResponse
impl From<&Collaborator> for CollaboratorResponse
Source§fn from(c: &Collaborator) -> Self
fn from(c: &Collaborator) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Collaborator
impl RefUnwindSafe for Collaborator
impl Send for Collaborator
impl Sync for Collaborator
impl Unpin for Collaborator
impl UnwindSafe for Collaborator
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