pub struct ConnectionConfig<CtxT> {
    pub context: CtxT,
    pub max_in_flight_operations: usize,
    pub keep_alive_interval: Duration,
}
Expand description

ConnectionConfig is used to configure the connection once the client sends the ConnectionInit message.

Fields§

§context: CtxT

Custom-provided juniper::Context.

§max_in_flight_operations: usize

Maximum number of in-flight operations that a connection can have.

If this number is exceeded, attempting to start more will result in an error. By default, there is no limit to in-flight operations.

§keep_alive_interval: Duration

Interval at which to send keep-alives.

Specifying a Duration::ZERO will disable keep-alives.

By default, keep-alives are sent every 15 seconds.

Implementations§

source§

impl<CtxT> ConnectionConfig<CtxT>

source

pub fn new(context: CtxT) -> Self

Constructs the configuration required for a connection to be accepted.

source

pub fn with_max_in_flight_operations(self, max: usize) -> Self

Specifies the maximum number of in-flight operations that a connection can have.

If this number is exceeded, attempting to start more will result in an error. By default, there is no limit to in-flight operations.

source

pub fn with_keep_alive_interval(self, interval: Duration) -> Self

Specifies the interval at which to send keep-alives.

Specifying a Duration::ZERO will disable keep-alives.

By default, keep-alives are sent every 15 seconds.

Trait Implementations§

source§

impl<CtxT: Clone> Clone for ConnectionConfig<CtxT>

source§

fn clone(&self) -> ConnectionConfig<CtxT>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<CtxT: Debug> Debug for ConnectionConfig<CtxT>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<S: ScalarValue, CtxT: Unpin + Send + 'static> Init<S, CtxT> for ConnectionConfig<CtxT>

§

type Error = Infallible

The error that is returned on failure. The formatted error will be used as the contents of the “message” field sent back to the client.
§

type Future = Ready<Result<ConnectionConfig<CtxT>, <ConnectionConfig<CtxT> as Init<S, CtxT>>::Error>>

The future configuration type.
source§

fn init(self, _params: Variables<S>) -> Self::Future

Returns a future for the configuration to use.
source§

impl<CtxT: Copy> Copy for ConnectionConfig<CtxT>

Auto Trait Implementations§

§

impl<CtxT> Freeze for ConnectionConfig<CtxT>
where CtxT: Freeze,

§

impl<CtxT> RefUnwindSafe for ConnectionConfig<CtxT>
where CtxT: RefUnwindSafe,

§

impl<CtxT> Send for ConnectionConfig<CtxT>
where CtxT: Send,

§

impl<CtxT> Sync for ConnectionConfig<CtxT>
where CtxT: Sync,

§

impl<CtxT> Unpin for ConnectionConfig<CtxT>
where CtxT: Unpin,

§

impl<CtxT> UnwindSafe for ConnectionConfig<CtxT>
where CtxT: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.