ConjureRuntime

Struct ConjureRuntime 

Source
pub struct ConjureRuntime { /* private fields */ }
Expand description

A type providing server logic that is configured at runtime.

Implementations§

Source§

impl ConjureRuntime

Source

pub fn new() -> Self

Creates a new runtime with default settings.

Source

pub fn builder() -> Builder

Creates a new builder.

Source

pub fn request_body_encoding( &self, headers: &HeaderMap, ) -> Result<&(dyn Encoding + Sync + Send), Error>

Returns the appropriate Encoding to deserialize the request body.

The implementation currently compares the request’s Content-Type header against Encoding::content_type, ignoring parameters.

Source

pub fn response_body_encoding( &self, headers: &HeaderMap, ) -> Result<&(dyn Encoding + Sync + Send), Error>

Returns the appropriate Encoding to serialize the response body.

The MIME types in the request’s Accept header are processed in accordance with RFC 9110. If two MIME types have equal preference by that algorithm, the implementation will prefer the type declared earlier in the header.

MIME types are matched against Encoding::content_type, ignoring parameters. If multiple Encodings are matched against the same MIME type, the encoding registered first by Builder::encoding will be selected.

The implementation treats the absence of the Accept header equivalently to Accept: */*.

Trait Implementations§

Source§

impl Default for ConjureRuntime

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.