[][src]Trait rr_mux::connector::Connector

pub trait Connector<ReqId, Target, Req, Resp, E, Ctx> {
    fn request<'life0, 'async_trait>(
        &'life0 mut self,
        ctx: Ctx,
        req_id: ReqId,
        target: Target,
        req: Req
    ) -> Pin<Box<dyn Future<Output = Result<Resp, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn respond<'life0, 'async_trait>(
        &'life0 mut self,
        ctx: Ctx,
        req_id: ReqId,
        target: Target,
        resp: Resp
    ) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Connector provides generic support for making and responding to requests This allows protocols to be implemented over an arbitrary transport ReqId is an ID used to associate requests and responses Target is a target address REQ is a request type RESP is a response type E is the underlying connector error Ctx is a context passed through requests to underlying handlers

Required methods

fn request<'life0, 'async_trait>(
    &'life0 mut self,
    ctx: Ctx,
    req_id: ReqId,
    target: Target,
    req: Req
) -> Pin<Box<dyn Future<Output = Result<Resp, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

fn respond<'life0, 'async_trait>(
    &'life0 mut self,
    ctx: Ctx,
    req_id: ReqId,
    target: Target,
    resp: Resp
) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

impl<BaseReq, BaseResp, MappedReq, MappedResp, ReqId, Target, E, Ctx, Conn, M> Connector<ReqId, Target, MappedReq, MappedResp, E, Ctx> for Mapped<BaseReq, BaseResp, MappedReq, MappedResp, ReqId, Target, E, Ctx, Conn, M> where
    ReqId: Eq + Hash + Debug + Clone + Send + 'static,
    Target: Debug + Send + 'static,
    BaseReq: Debug + Send + 'static,
    BaseResp: Debug + Send + 'static,
    MappedReq: Debug + Send + 'static,
    MappedResp: Debug + Send + 'static,
    E: Debug + Send + 'static,
    Ctx: Clone + Send + 'static,
    Conn: Connector<ReqId, Target, BaseReq, BaseResp, E, Ctx> + Send + 'static,
    M: Mapper<Original = Muxed<BaseReq, BaseResp>, Mapped = Muxed<MappedReq, MappedResp>> + Clone + Send + 'static, 
[src]

impl<Id, Addr, Req, Resp, E, Ctx> Connector<Id, Addr, Req, Resp, E, Ctx> for MockConnector<Addr, Req, Resp, E, Ctx> where
    Id: PartialEq + Debug + Send + 'static,
    Addr: PartialEq + Debug + Send + 'static,
    Req: PartialEq + Debug + Send + 'static,
    Resp: PartialEq + Debug + Send + 'static,
    E: PartialEq + Debug + Send + 'static,
    Ctx: Clone + PartialEq + Debug + Send + 'static, 
[src]

fn request<'life0, 'async_trait>(
    &'life0 mut self,
    ctx: Ctx,
    _id: Id,
    addr: Addr,
    req: Req
) -> Pin<Box<dyn Future<Output = Result<Resp, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Make a request and return the pre-set response This checks the request against the specified expectations

fn respond<'life0, 'async_trait>(
    &'life0 mut self,
    ctx: Ctx,
    _id: Id,
    addr: Addr,
    resp: Resp
) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Make a response This checks the response against provided expectations

impl<ReqId, Target, Req, Resp, E, Ctx> Connector<ReqId, Target, Req, Resp, E, Ctx> for Mux<ReqId, Target, Req, Resp, E, Ctx> where
    ReqId: Eq + Hash + Debug + Clone + Send + 'static,
    Target: Debug + Send + 'static,
    Req: Debug + Send + 'static,
    Resp: Debug + Send + 'static,
    E: Debug + Send + 'static,
    Ctx: Debug + Clone + Send + 'static, 
[src]

fn request<'life0, 'async_trait>(
    &'life0 mut self,
    ctx: Ctx,
    id: ReqId,
    addr: Target,
    req: Req
) -> Pin<Box<dyn Future<Output = Result<Resp, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Send and register a request

impl<ReqId, Target, Req, Resp, E, Ctx> Connector<ReqId, Target, Req, Resp, E, Ctx> for WireMux<ReqId, Target, Req, Resp, E, Ctx> where
    ReqId: Clone + Hash + Eq + PartialEq + Debug + Send + 'static,
    Target: Clone + Hash + PartialEq + Eq + Send + 'static,
    Req: PartialEq + Debug + Send + 'static,
    Resp: PartialEq + Debug + Send + 'static,
    E: PartialEq + Debug + Send + 'static,
    Ctx: Clone + PartialEq + Debug + Send + 'static, 
[src]

Loading content...