[go: up one dir, main page]

Struct hoot::client::Request

source ·
pub struct Request<'a, S: State, V: Version, M: Method, B: BodyType> { /* private fields */ }

Implementations§

source§

impl<'a> Request<'a, (), (), (), ()>

source

pub fn new(buf: &'a mut [u8]) -> Request<'a, INIT, (), (), ()>

source§

impl<'a, S: State, V: Version, M: Method, B: BodyType> Request<'a, S, V, M, B>

source

pub fn flush(self) -> Output<'a, S, V, M, B>

source

pub fn resume( token: ResumeToken<S, V, M, B>, buf: &'a mut [u8] ) -> Request<'a, S, V, M, B>

source§

impl<'a> Request<'a, INIT, (), (), ()>

source

pub fn http_10(self) -> Request<'a, SEND_LINE, HTTP_10, (), ()>

source

pub fn http_11(self) -> Request<'a, SEND_LINE, HTTP_11, (), ()>

source§

impl<'a> Request<'a, SEND_LINE, HTTP_10, (), ()>

source

pub fn get( self, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_10, GET, ()>, HootError>

source

pub fn head( self, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_10, HEAD, ()>, HootError>

source

pub fn post( self, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_10, POST, ()>, HootError>

source§

impl<'a> Request<'a, SEND_LINE, HTTP_11, (), ()>

source

pub fn get( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, GET, ()>, HootError>

source

pub fn head( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, HEAD, ()>, HootError>

source

pub fn post( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, POST, ()>, HootError>

source

pub fn put( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, PUT, ()>, HootError>

source

pub fn delete( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, DELETE, ()>, HootError>

source

pub fn connect( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, CONNECT, ()>, HootError>

source

pub fn options( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, OPTIONS, ()>, HootError>

source

pub fn trace( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, TRACE, ()>, HootError>

source

pub fn patch( self, host: &str, path: &str ) -> Result<Request<'a, SEND_HEADERS, HTTP_11, PATCH, ()>, HootError>

source§

impl<'a, M: Method, V: Version> Request<'a, SEND_HEADERS, V, M, ()>

source

pub fn header(self, name: &str, value: &str) -> Result<Self, HootError>

source

pub fn header_bytes(self, name: &str, bytes: &[u8]) -> Result<Self, HootError>

source§

impl<'a, M: MethodWithRequestBody> Request<'a, SEND_HEADERS, HTTP_10, M, ()>

source§

impl<'a, M: MethodWithRequestBody> Request<'a, SEND_HEADERS, HTTP_11, M, ()>

source§

impl<'a, V: Version, M: MethodWithoutRequestBody> Request<'a, SEND_HEADERS, V, M, ()>

source

pub fn send(self) -> Result<Request<'a, ENDED, (), (), ()>, HootError>

source§

impl<'a, V: Version, M: MethodWithRequestBody> Request<'a, SEND_BODY, V, M, BODY_LENGTH>

source

pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), HootError>

source

pub fn finish(self) -> Result<Request<'a, ENDED, (), (), ()>, HootError>

source§

impl<'a, V: Version, M: MethodWithRequestBody> Request<'a, SEND_BODY, V, M, BODY_CHUNKED>

source

pub fn write_chunk(self, bytes: &[u8]) -> Result<Self, HootError>

source

pub fn with_trailer( self ) -> Result<Request<'a, SEND_TRAILER, V, M, BODY_CHUNKED>, HootError>

source

pub fn finish(self) -> Result<Request<'a, ENDED, (), (), ()>, HootError>

source§

impl<'a, V: Version, M: MethodWithRequestBody> Request<'a, SEND_TRAILER, V, M, BODY_CHUNKED>

source

pub fn trailer(self, name: &str, value: &str) -> Result<Self, HootError>

source

pub fn trailer_bytes(self, name: &str, bytes: &[u8]) -> Result<Self, HootError>

source

pub fn finish(self) -> Result<Request<'a, ENDED, (), (), ()>, HootError>

Trait Implementations§

source§

impl<'a, S: State, V: Version, M: Method, B: BodyType> Debug for Request<'a, S, V, M, B>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, S, V, M, B> RefUnwindSafe for Request<'a, S, V, M, B>

§

impl<'a, S, V, M, B> Send for Request<'a, S, V, M, B>
where B: Send, M: Send, S: Send, V: Send,

§

impl<'a, S, V, M, B> Sync for Request<'a, S, V, M, B>
where B: Sync, M: Sync, S: Sync, V: Sync,

§

impl<'a, S, V, M, B> Unpin for Request<'a, S, V, M, B>
where B: Unpin, M: Unpin, S: Unpin, V: Unpin,

§

impl<'a, S, V, M, B> !UnwindSafe for Request<'a, S, V, M, B>

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

§

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.