[][src]Struct webtonic_server::Server

pub struct Server {}

The server endpoint of the WebTonic websocket bridge.

This is designet to be used similar to the Tonic implementation.

Example

Assuming we have the greeter example in scope, we can serve an endpoint like so:

let greeter = MyGreeter::default();

webtonic_server::Server::builder()
    .add_service(GreeterServer::new(greeter))
    .serve(([127, 0, 0, 1], 8080))
    .await;

Implementations

impl Server[src]

pub fn builder() -> Self[src]

Create a new Server builder.

Returns

A Server in default configuration.

pub fn add_service<A>(self, service: A) -> Router<A, Unimplemented> where
    A: Service<Request<BoxBody>, Response = Response<BoxBody>> + Sync + Send + 'static, 
[src]

Add a Service to the route (see example).

Arguments

Returns

  • A Router, which included the old routes and the new service. This also means you need to finish server configuration before calling this function.

Trait Implementations

impl Clone for Server[src]

impl Debug for Server[src]

Auto Trait Implementations

impl RefUnwindSafe for Server

impl Send for Server

impl Sync for Server

impl Unpin for Server

impl UnwindSafe for Server

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>, 

impl<T> WithSubscriber for T[src]