Trait GrpcClientType

Source
pub trait GrpcClientType: Sync + Send {
    type RawGrpcClient;

    // Required methods
    fn create_scoped_client(
        project_id: ValidShardedId<ProjectId>,
        request_id: RequestId,
        channel: Channel,
        interceptor: GrpcRequestInterceptor,
    ) -> Self;
    fn get_mut(&mut self) -> &mut ScopedGrpcClient<Self::RawGrpcClient>;
    fn address_map(config: &MainConfig) -> &HashMap<u64, String>;

    // Provided methods
    fn create_channel<'life0, 'async_trait>(
        address: &'life0 str,
    ) -> Pin<Box<dyn Future<Output = Result<Channel, GrpcClientError>> + Send + 'async_trait>>
       where 'life0: 'async_trait { ... }
    fn get_address(
        config: &MainConfig,
        _project_id: &ValidShardedId<ProjectId>,
    ) -> Result<String, GrpcClientError> { ... }
}

Required Associated Types§

Required Methods§

Source

fn create_scoped_client( project_id: ValidShardedId<ProjectId>, request_id: RequestId, channel: Channel, interceptor: GrpcRequestInterceptor, ) -> Self

Source

fn get_mut(&mut self) -> &mut ScopedGrpcClient<Self::RawGrpcClient>

Source

fn address_map(config: &MainConfig) -> &HashMap<u64, String>

Provided Methods§

Source

fn create_channel<'life0, 'async_trait>( address: &'life0 str, ) -> Pin<Box<dyn Future<Output = Result<Channel, GrpcClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait,

Source

fn get_address( config: &MainConfig, _project_id: &ValidShardedId<ProjectId>, ) -> Result<String, GrpcClientError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§