create_client_from_provider

Function create_client_from_provider 

Source
pub fn create_client_from_provider(
    provider: &dyn TokenProvider,
) -> Result<Octocrab>
Expand description

Creates a GitHub client from a TokenProvider.

This is a convenience function that extracts the token from a provider and creates an authenticated Octocrab client. It standardizes error handling across the facade layer.

§Arguments

  • provider - Token provider that supplies the GitHub token

§Returns

Returns Ok(Octocrab) if successful, or an AptuError::GitHub if:

  • The provider has no token available
  • The GitHub client fails to build

§Example

let client = create_client_from_provider(provider)?;