Struct dyer::component::profile::Profile[][src]

pub struct Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
{ pub headers: HashMap<String, String>, pub cookie: HashMap<String, String>, pub able: f64, pub created: f64, pub pargs: Option<P>, }

Infomation represented to the server, generally, it provide extra, meta data about users and users’ devices, required by server, basically, includes User-Agent, Accept-Encoding and so on. For the purposes of extension, customized generic parameter P is required.

Fields

headers: HashMap<String, String>

represents a heahers

cookie: HashMap<String, String>

cookie set by server or user

able: f64

checkpoint by which this Profile is valid for Request

created: f64

meta data that the Profile is created

pargs: Option<P>

additional arguments for extensive application

Implementations

impl<P> Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

pub fn exec<T>(res: &mut Response<T, P>) -> Result<Profile<P>, ResError> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

default method used to extract Profile from a Response, collecting all cookie by set-cookie and ignoring others.

pub async fn exec_all<'a, E, T>(
    profiles: Arc<Mutex<Vec<Profile<P>>>>,
    num: usize,
    f: ProfileInfo<'a, T, P>
) where
    T: Serialize + for<'de> Deserialize<'de> + Debug + Clone,
    P: Serialize + for<'de> Deserialize<'de> + Debug + Clone,
    E: Serialize + Debug + Clone
[src]

generate multiple Profile and put them into App for different uri, different generator functions are required.

impl<P> Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

pub fn stored(path: &str, profiles: &mut Arc<Mutex<Vec<Profile<P>>>>)[src]

store unfinished or extra Profiles,

pub fn load(path: &str) -> Vec<Profile<P>>[src]

load unfinished or extra Profiles

Trait Implementations

impl<P: Clone> Clone for Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<P: Debug> Debug for Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<P> Default for Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<'de, P> Deserialize<'de> for Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone,
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<P> Send for Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<P> Serialize for Profile<P> where
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone,
    P: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for Profile<P> where
    P: RefUnwindSafe

impl<P> Sync for Profile<P> where
    P: Sync

impl<P> Unpin for Profile<P> where
    P: Unpin

impl<P> UnwindSafe for Profile<P> where
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.