pub struct RequestorHelper;

Implementations§

source§

impl RequestorHelper

source

pub fn new_response(code: StatusCode) -> Response

source

pub fn new_ok_response<R>() -> Rwhere R: From<Response>,

source

pub fn trans_error<R>(e: BuckyError) -> Rwhere R: From<Response>,

source

pub async fn error_from_resp(resp: &mut Response) -> BuckyError

source

pub fn insert_device_list_header( http_req: &mut Request, device_list: &Vec<DeviceId> )

source

pub fn insert_headers<T>(http_req: &mut Request, name: &str, list: &Vec<T>)where T: ToString,

source

pub fn insert_headers_with_encoding<T>( http_req: &mut Request, name: &str, list: &Vec<T> )where T: ToString,

source

pub fn trans_status_code(code: StatusCode) -> BuckyErrorCode

source

pub fn decode_optional_hex_header<R>( req: &R, name: &str ) -> BuckyResult<Option<Vec<u8>>>where R: HeaderOp,

source

pub fn decode_optional_header<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Option<T>>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_utf8<'a>( name: &'a str, value: &'a str ) -> BuckyResult<Cow<'a, str>>

source

pub fn decode_optional_header_with_utf8_decoding<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Option<T>>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_header<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<T>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_header_with_utf8_decoding<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<T>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_optional_headers<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Option<Vec<T>>>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_headers<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Vec<T>>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_optional_headers_with_utf8_decoding<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Option<Vec<T>>>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_headers_with_utf8_decoding<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Vec<T>>where R: HeaderOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_json_header<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<T>where R: HeaderOp, T: JsonCodec<T>,

source

pub fn decode_optional_json_header<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Option<T>>where R: HeaderOp, T: JsonCodec<T>,

source

pub fn decode_optional_json_headers<T, R>( req: &R, name: impl Into<HeaderName> ) -> BuckyResult<Option<Vec<T>>>where R: HeaderOp, T: JsonCodec<T>,

source

pub async fn decode_raw_data_body<R>(body: &mut R) -> BuckyResult<Vec<u8>>where R: BodyOp,

source

pub async fn decode_raw_object_body<R, T>(body: &mut R) -> BuckyResult<T>where R: BodyOp, T: for<'d> RawDecode<'d>,

source

pub async fn decode_str_body<R, T>(body: &mut R) -> BuckyResult<T>where R: BodyOp, T: FromStr, <T as FromStr>::Err: Display,

source

pub async fn decode_json_body<R, T>(resp: &mut R) -> BuckyResult<T>where R: BodyOp, T: JsonCodec<T>,

source

pub async fn decode_serde_json_body<R, T>(resp: &mut R) -> BuckyResult<T>where R: BodyOp, T: for<'de> Deserialize<'de>,

source

pub fn decode_url_param<T>(k: Cow<'_, str>, v: Cow<'_, str>) -> BuckyResult<T>where T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_url_param_with_utf8_decoding<T>( k: Cow<'_, str>, v: Cow<'_, str> ) -> BuckyResult<T>where T: FromStr, <T as FromStr>::Err: Display,

source

pub fn decode_url_param_list<T>( k: Cow<'_, str>, v: Cow<'_, str> ) -> BuckyResult<Vec<T>>where T: FromStr, <T as FromStr>::Err: Display,

source

pub fn encode_opt_header<T, R>(req: &mut R, name: &str, value: &Option<T>)where R: HeaderOp, T: ToString,

source

pub fn encode_opt_header_with_encoding<R>( req: &mut R, name: &str, value: Option<&str> )where R: HeaderOp,

source

pub fn encode_header<T, R>(req: &mut R, name: &str, value: &T)where R: HeaderOp, T: ToString,

source

pub fn encode_header_with_encoding<R>(req: &mut R, name: &str, value: &str)where R: HeaderOp,

source

pub fn encode_time_header<R>( req: &mut R, name: impl Into<HeaderName>, bucky_time: u64 )where R: HeaderOp,

source

pub async fn request_to_service( service_addr: &SocketAddr, req: Request ) -> BuckyResult<Response>

source

pub fn value_from_querys<T>(name: &str, url: &Url) -> BuckyResult<Option<T>>where T: FromStr, <T as FromStr>::Err: Display,

source

pub fn value_from_querys_with_utf8_decoding<T>( name: &str, url: &Url ) -> BuckyResult<Option<T>>where T: FromStr, <T as FromStr>::Err: Display,

source

pub fn dec_id_from_request(req: &Request) -> BuckyResult<Option<ObjectId>>

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V