Trait in3::traits::Transport[][src]

pub trait Transport {
#[must_use]    fn fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
        &'life0 mut self,
        method: &'life1 str,
        request: &'life2 str,
        uris: &'life3 [&'life4 str],
        headers: &'life5 [&'life6 str]
    ) -> Pin<Box<dyn Future<Output = Vec<Result<String, String>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait,
        'life5: 'async_trait,
        'life6: 'async_trait,
        Self: 'async_trait
; }

Transport trait methods.

Interface for a facility that encapsulates getting data from a remote endpoint, potentially across network/system boundaries.

Required methods

#[must_use]fn fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    request: &'life2 str,
    uris: &'life3 [&'life4 str],
    headers: &'life5 [&'life6 str]
) -> Pin<Box<dyn Future<Output = Vec<Result<String, String>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
    'life5: 'async_trait,
    'life6: 'async_trait,
    Self: 'async_trait, 
[src]

Sends the request to all of the uris (endpoints) and delivers the response as Strings in an async fashion.

Loading content...

Implementors

impl Transport for HttpTransport[src]

Transport trait implementation for HTTP transport.

fn fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
    &'life0 mut self,
    method: &'life1 str,
    request: &'life2 str,
    uris: &'life3 [&'life4 str],
    headers: &'life5 [&'life6 str]
) -> Pin<Box<dyn Future<Output = Vec<Result<String, String>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
    'life5: 'async_trait,
    'life6: 'async_trait,
    Self: 'async_trait, 
[src]

Fetches the responses from specified URLs over HTTP. Errors are reported as strings.

impl Transport for MockJsonTransport[src]

fn fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
    &'life0 mut self,
    _method: &'life1 str,
    request_: &'life2 str,
    _uris: &'life3 [&'life4 str],
    _headers: &'life5 [&'life6 str]
) -> Pin<Box<dyn Future<Output = Vec<Result<String, String>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
    'life5: 'async_trait,
    'life6: 'async_trait,
    Self: 'async_trait, 
[src]

Async fetch implementation

Read responses from json

impl<'impl0> Transport for MockTransport<'impl0>[src]

Transport trait implementation for mocking in tests.

fn fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
    &'life0 mut self,
    _method: &'life1 str,
    request: &'life2 str,
    _uris: &'life3 [&'life4 str],
    _headers: &'life5 [&'life6 str]
) -> Pin<Box<dyn Future<Output = Vec<Result<String, String>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
    'life5: 'async_trait,
    'life6: 'async_trait,
    Self: 'async_trait, 
[src]

Async fetch implementation

Pops the responses vector and returns it if it’s associated request matches the i/p. Otherwise, returns an error string.

Loading content...