Skip to main content

EndhostApiClient

Trait EndhostApiClient 

Source
pub trait EndhostApiClient: Send + Sync {
    // Required methods
    fn list_underlays<'life0, 'async_trait>(
        &'life0 self,
        isd_as: IsdAsn,
    ) -> Pin<Box<dyn Future<Output = Result<Underlays, CrpcClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_segments<'life0, 'async_trait>(
        &'life0 self,
        src: IsdAsn,
        dst: IsdAsn,
        page_size: i32,
        page_token: String,
    ) -> Pin<Box<dyn Future<Output = Result<SegmentsPage, CrpcClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Endhost API client trait.

This allows for a client mock implementation in tests.

Required Methods§

Source

fn list_underlays<'life0, 'async_trait>( &'life0 self, isd_as: IsdAsn, ) -> Pin<Box<dyn Future<Output = Result<Underlays, CrpcClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List the available underlays for a given ISD-AS.

§Arguments
  • isd_as - The ISD-AS to list the underlays for. For a wildcard ISD AS (IsdAsn::WILDCARD), all existing underlays will be returned.
§Returns

A future that resolves to the list of underlays.

Source

fn list_segments<'life0, 'async_trait>( &'life0 self, src: IsdAsn, dst: IsdAsn, page_size: i32, page_token: String, ) -> Pin<Box<dyn Future<Output = Result<SegmentsPage, CrpcClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List the available segments between a source and destination ISD-AS.

§Arguments
  • src - The source ISD-AS.
  • dst - The destination ISD-AS.
  • page_size - The maximum number of segments to return.
  • page_token - The token to use for pagination.

Implementors§