Skip to main content

TsHttpClient

Struct TsHttpClient 

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

Interprets typed HTTP programs as a TypeScript client module.

Nothing is applied and no request is made. Each endpoint is read for what a caller states and what they receive, which is the same program an executing interpretation answers.

Implementations§

Source§

impl TsHttpClient

Source

pub fn new(members: Spelling) -> Self

Emits a client whose member and parameter names are spelled this way.

Trait Implementations§

Source§

impl BytesOutAlg for TsHttpClient

Source§

type Bytes<From> = TsBytesOutput

The raw-byte converter selected for From.
Source§

impl Clone for TsHttpClient

Source§

fn clone(&self) -> TsHttpClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for TsHttpClient

Source§

impl Debug for TsHttpClient

Source§

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

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

impl EmptyOutAlg for TsHttpClient

Source§

type Empty<From> = TsEmptyOutput

The empty converter selected for From.
Source§

impl FileOutAlg for TsHttpClient

Source§

type File<From> = TsFileOutput

The streamed-file converter selected for From.
Source§

impl HandlerAlg for TsHttpClient

Source§

type Endpoint = TsCall

The interpreter’s homogeneous endpoint representation.
Source§

impl<Context> HandlerContextAlg<Context> for TsHttpClient
where Context: Send + Sync + 'static,

Source§

type Handle = Arc<Context>

The owned carrier cloned into asynchronous operation invocations.
Source§

impl<Handle, Inputs, Args, Transform, Answering, Output> HandlerEndpointAlg<Handle, Inputs, Args, Transform, Output> for TsHttpClient
where Inputs: TsInputsAlg, Transform: OutputKindAlg<Self, Output, Transform = Answering>, Answering: TsOutputAlg<Output>,

Source§

fn finish_handler<Handler>(&self, _handler: Handler) -> TsCall
where Handler: OperationAlg + ApplyAlg<Handle, Args, Output = Output> + Send + Sync + 'static,

Interprets a typed first-order handler as a concrete endpoint. Read more
Source§

impl HeaderOutAlg for TsHttpClient

Source§

type Header<Inner, Name> = TsHeaderOutput<Inner, Name>

The converter writing Name beside the body Inner states.
Source§

impl HtmlOutAlg for TsHttpClient

Source§

type Html<From> = TsHtmlOutput

The HTML converter selected for From.
Source§

impl HttpInputAlg for TsHttpClient

Source§

type Path<I> = TsPathInput<I>

The interpreter’s path extractor for Input.
Source§

type Query<I> = TsQueryInput<I>

The interpreter’s query extractor for Input.
Source§

type Body<I> = TsBodyInput<I>

The interpreter’s request-body extractor for Input.
Source§

type Form<I> = TsFormInput<I>

The interpreter’s form-encoded request-body extractor for Input.
Source§

type Multipart<I> = TsMultipartInput<I>

The interpreter’s extractor for Input read from a body arriving as parts.
Source§

type RawBody<I> = TsRawBodyInput<I>

The interpreter’s unread request-body extractor for Input.
Source§

type Header<I> = TsHeaderInput<I>

The interpreter’s header extractor for Input. Read more
Source§

type Cookie<I> = TsCookieInput<I>

The interpreter’s cookie extractor for Input.
Source§

type Auth<I> = TsHeaderInput<I>

The interpreter’s authentication extractor for Input.
Source§

type Context<I> = TsUnstatedInput<I>

The interpreter’s endpoint-context extractor for Input.
Source§

impl HttpSelectorAlg for TsHttpClient

Source§

type Selector = TsSelector

The interpreter’s HTTP selector representation.
Source§

fn http_method(&self, method: HttpMethod) -> Self::Selector

Interprets a request-method selector.
Source§

fn http_path(&self, path: &RoutePath) -> Self::Selector

Interprets an exact path selector.
Source§

fn http_prefix(&self, prefix: &RoutePath) -> Self::Selector

Interprets a path-prefix selector.
Source§

impl JsonOutAlg for TsHttpClient

Source§

type Json<From> = TsJsonOutput

The JSON converter selected for From.
Source§

impl RedirectOutAlg for TsHttpClient

Source§

type Redirect<From> = TsRedirectOutput

The redirect converter selected for From.
Source§

impl ResultOutAlg for TsHttpClient

Source§

type Result<Inner, Error> = TsResultOutput<Inner, Error>

The converter answering with Inner on success and with what Error means otherwise.
Source§

impl RouteAlg for TsHttpClient

Source§

type Route = TsHttpModule

The interpreter’s composed route representation.
Source§

type Selector = TsSelector

The selector applied to a route or endpoint.
Source§

type Endpoint = TsCall

The homogeneous endpoint representation lifted into routes.
Source§

fn initial(&self) -> Self::Route

Returns the initial route.
Source§

fn coproduct(&self, left: Self::Route, right: Self::Route) -> Self::Route

Forms the coproduct of two routes.
Source§

fn precompose( &self, selector: Self::Selector, route: Self::Route, ) -> Self::Route

Precomposes a route with a selector.
Source§

fn lift(&self, endpoint: Self::Endpoint) -> Self::Route

Lifts an endpoint into a route.
Source§

impl SelectorAlg for TsHttpClient

Source§

type Selector = TsSelector

The interpreter’s selector representation.
Source§

fn identity(&self) -> Self::Selector

Returns the selector identity.
Source§

fn compose( &self, first: Self::Selector, second: Self::Selector, ) -> Self::Selector

Composes two selectors from left to right.
Source§

impl StatusOutAlg for TsHttpClient

Source§

type Status<Inner, const CODE: u16> = TsStatusOutput<Inner, CODE>

The converter answering with CODE and the body Inner states.
Source§

impl StreamOutAlg for TsHttpClient

Source§

type Stream<From> = TsStreamOutput

The streamed converter selected for From.
Source§

impl TextOutAlg for TsHttpClient

Source§

type Text<From> = TsTextOutput

The plain-text converter selected for From.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<_INNER> HttpApiAlg for _INNER
where _INNER: HandlerAlg + HttpInputAlg + HttpRouteAlg<Endpoint = <_INNER as HandlerAlg>::Endpoint> + RouteAlg,

Source§

impl<This> HttpProgramExt<This> for This

Source§

fn compile_http<Program>( &self, program: Program, ) -> <Program as HttpProgramAlg<This>>::Route
where Program: HttpProgramAlg<This>,

Compiles a named HTTP program with this interpreter.

Source§

impl<_INNER> HttpRouteAlg for _INNER
where _INNER: HttpSelectorAlg<Selector = <_INNER as SelectorAlg>::Selector> + RouteAlg<Selector = <_INNER as SelectorAlg>::Selector> + SelectorAlg,

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<This> RouteAlgExt<This> for This
where This: RouteAlg,

Source§

fn routes(&self) -> Routes<'_, This>

Starts with the initial route.

Source§

fn route(&self, route: <This as RouteAlg>::Route) -> Routes<'_, This>

Wraps an already interpreted route for further fluent composition.

Source§

impl<This> ShapeProgramExt<This> for This

Source§

fn compile_shape<Program>( &self, program: Program, ) -> <Program as ShapeProgramAlg<This>>::Ty
where Program: ShapeProgramAlg<This>,

Folds a declaration with this interpretation.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.