Struct netapp::endpoint::Endpoint

source ·
pub struct Endpoint<M, H>where
    M: Message,
    H: StreamingEndpointHandler<M>,{ /* private fields */ }
Expand description

This struct represents an endpoint for message of type M.

Creating a new endpoint is done by calling NetApp::endpoint. An endpoint is identified primarily by its path, which is specified at creation time.

An Endpoint is used both to send requests to remote nodes, and to specify the handler for such requests on the local node. The type H represents the type of the handler object for endpoint messages (see StreamingEndpointHandler).

Implementations§

source§

impl<M, H> Endpoint<M, H>where M: Message, H: StreamingEndpointHandler<M>,

source

pub fn path(&self) -> &str

Get the path of this endpoint

source

pub fn set_handler(&self, h: Arc<H>)

Set the object that is responsible of handling requests to this endpoint on the local node.

source

pub async fn call_streaming<T>( &self, target: &NodeID, req: T, prio: RequestPriority ) -> Result<Resp<M>, Error>where T: IntoReq<M>,

Call this endpoint on a remote node (or on the local node, for that matter). This function invokes the full version that allows to attach a stream to the request and to receive such a stream attached to the response.

source

pub async fn call( &self, target: &NodeID, req: M, prio: RequestPriority ) -> Result<<M as Message>::Response, Error>

Call this endpoint on a remote node. This function is the simplified version that doesn’t allow to have streams attached to the request or the response; see call_streaming for the full version.

Auto Trait Implementations§

§

impl<M, H> !RefUnwindSafe for Endpoint<M, H>

§

impl<M, H> Send for Endpoint<M, H>

§

impl<M, H> Sync for Endpoint<M, H>

§

impl<M, H> Unpin for Endpoint<M, H>where M: Unpin,

§

impl<M, H> !UnwindSafe for Endpoint<M, H>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V