pub struct GraphClient<'a> { /* private fields */ }Expand description
Client for the Microsoft Graph API.
Provides Entra ID user lookups needed to distinguish internal users (“Member”) from external/guest users (“Guest”) in RBAC policy evaluation.
Implementations§
Source§impl<'a> GraphClient<'a>
impl<'a> GraphClient<'a>
Sourcepub async fn get_user(&self, principal_id: &str) -> Result<Option<GraphUser>>
pub async fn get_user(&self, principal_id: &str) -> Result<Option<GraphUser>>
Get a single user by their object ID (principal ID).
Returns None if the user is not found (404).
Sourcepub async fn list_service_principals(
&self,
filter: &str,
) -> Result<Vec<GraphServicePrincipal>>
pub async fn list_service_principals( &self, filter: &str, ) -> Result<Vec<GraphServicePrincipal>>
List service principals matching an OData $filter expression.
Example: find the Databricks SCIM provisioning connector:
ⓘ
let results = graph
.list_service_principals("displayName eq 'Azure Databricks SCIM Provisioning Connector'")
.await?;Sourcepub async fn batch_get_users(
&self,
principal_ids: &[&str],
) -> Result<HashMap<String, GraphUser>>
pub async fn batch_get_users( &self, principal_ids: &[&str], ) -> Result<HashMap<String, GraphUser>>
Batch-fetch multiple users by their object IDs.
Returns a map of principal_id → GraphUser for users that were found.
Not-found (404) entries are silently omitted from the result.
Internally uses $batch to resolve up to 20 IDs per HTTP call,
handling chunking automatically for larger sets.
Auto Trait Implementations§
impl<'a> Freeze for GraphClient<'a>
impl<'a> !RefUnwindSafe for GraphClient<'a>
impl<'a> Send for GraphClient<'a>
impl<'a> Sync for GraphClient<'a>
impl<'a> Unpin for GraphClient<'a>
impl<'a> UnsafeUnpin for GraphClient<'a>
impl<'a> !UnwindSafe for GraphClient<'a>
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