[][src]Struct kayrx::jrpc::raw::RawServer

pub struct RawServer<R, I> { /* fields omitted */ }

Wraps around a "raw server" and adds capabilities.

See the module-level documentation for more information.

Methods

impl<R, I> RawServer<R, I> where
    R: TransportServer<RequestId = I>,
    I: Clone + PartialEq + Eq + Hash + Send + Sync
[src]

pub fn new(inner: R) -> RawServer<R, I>[src]

Starts a RawServer using the given raw server internally.

impl<R, I> RawServer<R, I> where
    R: TransportServer<RequestId = I>,
    I: Clone + PartialEq + Eq + Hash + Send + Sync
[src]

pub async fn next_event<'a>(&'a mut self) -> RawServerEvent<'a, R, I>[src]

Returns a Future resolving to the next event that this server generates.

pub fn request_by_id<'a>(
    &'a mut self,
    id: &RawServerRequestId
) -> Option<RawServerRequest<'a, R, I>>
[src]

Returns a request previously returned by next_event by its id.

Note that previous notifications don't have an ID and can't be accessed with this method.

Returns None if the request ID is invalid or if the request has already been answered in the past.

pub fn subscription_by_id(
    &mut self,
    id: RawServerSubscriptionId
) -> Option<ServerSubscription<R, I>>
[src]

Returns a subscription previously returned by into_subscription.

Trait Implementations

impl<R> From<R> for RawServer<R, R::RequestId> where
    R: TransportServer
[src]

impl<R, I> From<RawServer<R, I>> for Server where
    R: TransportServer<RequestId = I> + Send + Sync + 'static,
    I: Clone + PartialEq + Eq + Hash + Send + Sync + 'static, 
[src]

Initializes a new server based upon this raw server.

Auto Trait Implementations

impl<R, I> RefUnwindSafe for RawServer<R, I> where
    I: RefUnwindSafe,
    R: RefUnwindSafe

impl<R, I> Send for RawServer<R, I> where
    I: Send,
    R: Send

impl<R, I> Sync for RawServer<R, I> where
    I: Sync,
    R: Sync

impl<R, I> Unpin for RawServer<R, I> where
    I: Unpin,
    R: Unpin

impl<R, I> UnwindSafe for RawServer<R, I> where
    I: RefUnwindSafe + UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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