pub struct InstallationPermissions {
pub issues: PermissionLevel,
pub pull_requests: PermissionLevel,
pub contents: PermissionLevel,
pub metadata: PermissionLevel,
pub checks: PermissionLevel,
pub actions: PermissionLevel,
}Expand description
Permissions granted to a GitHub App installation.
Each permission can be set to None, Read, Write, or Admin level. See GitHub’s documentation for details on what each permission allows.
§GitHub API Compatibility
The GitHub API returns permissions as optional fields - installations only
include permissions they were granted during installation. This struct uses
#[serde(default)] to automatically default missing fields to PermissionLevel::None,
which provides better ergonomics than Option<PermissionLevel> while accurately
representing the API semantics (missing permission = no permission).
§Examples
// Partial permissions from GitHub API (only metadata and contents)
let json = r#"{"metadata": "read", "contents": "read"}"#;
let perms: InstallationPermissions = serde_json::from_str(json).unwrap();
assert_eq!(perms.metadata, PermissionLevel::Read);
assert_eq!(perms.contents, PermissionLevel::Read);
assert_eq!(perms.issues, PermissionLevel::None); // Defaulted
assert_eq!(perms.pull_requests, PermissionLevel::None); // DefaultedFields§
§issues: PermissionLevel§pull_requests: PermissionLevel§contents: PermissionLevel§metadata: PermissionLevel§checks: PermissionLevel§actions: PermissionLevelTrait Implementations§
Source§impl Clone for InstallationPermissions
impl Clone for InstallationPermissions
Source§fn clone(&self) -> InstallationPermissions
fn clone(&self) -> InstallationPermissions
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 InstallationPermissions
impl Debug for InstallationPermissions
Source§impl Default for InstallationPermissions
impl Default for InstallationPermissions
Source§impl<'de> Deserialize<'de> for InstallationPermissionswhere
InstallationPermissions: Default,
impl<'de> Deserialize<'de> for InstallationPermissionswhere
InstallationPermissions: Default,
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 PartialEq for InstallationPermissions
impl PartialEq for InstallationPermissions
Source§impl Serialize for InstallationPermissions
impl Serialize for InstallationPermissions
impl Eq for InstallationPermissions
impl StructuralPartialEq for InstallationPermissions
Auto Trait Implementations§
impl Freeze for InstallationPermissions
impl RefUnwindSafe for InstallationPermissions
impl Send for InstallationPermissions
impl Sync for InstallationPermissions
impl Unpin for InstallationPermissions
impl UnsafeUnpin for InstallationPermissions
impl UnwindSafe for InstallationPermissions
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
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.