fn from_request(request: &'a Request<'r>) -> ::rocket::request::Outcome<AdministratorCookie,Self::Error>{
        let cid = AdministratorCookie::cookie_id();
        let mut cookies = request.cookies();
        
        match cookies.get_private(cid) {
            Some(cookie) => {
                if let Some(cookie_deserialized) = AdministratorCookie::retrieve_cookie(cookie.value().to_string()) {
                    Outcome::Success(
                        cookie_deserialized
                    )
                } else {
                    Outcome::Forward(())
                }
            },
            None => Outcome::Forward(())
        }
    }
/// The from_request inside the file defining the custom data types
/// enables the type to be checked directly in a route as a request guard
/// 
/// This is not needed but highly recommended.  Otherwise you would need to use:
/// 
/// `#[get("/protected")] fn admin_page(admin: AuthCont<AdministratorCookie>)`
/// 
/// instead of:
/// 
/// `#[get("/protected")] fn admin_page(admin: AdministratorCookie)`
The from_request inside the file defining the custom data types
enables the type to be checked directly in a route as a request guard

This is not needed but highly recommended.  Otherwise you would need to use.



instead of.


The from_request inside the file defining the custom data types enables the type to be checked directly in a route as a request guard This is not needed but highly recommended . Otherwise you would need to use . instead of .
fn from_request(request: &'a Request<'r>) -> ::rocket::request::Outcome<AdministratorCookie,Self::Error>{
        let cid = AdministratorCookie::cookie_id();
        let mut cookies = request.cookies();
        match cookies.get_private(cid) {
            Some(cookie) => {
                if let Some(cookie_deserialized) = AdministratorCookie::retrieve_cookie(cookie.value().to_string()) {
                    Outcome::Success(
                        cookie_deserialized
                    )
                } else {
                    Outcome::Forward(())
                }
            },
            None => Outcome::Forward(())
        }
    }
fn from_request ( request : & ' a Request < ' r > ) -> :: rocket :: request :: Outcome < AdministratorCookie , Self :: Error > { let cid = AdministratorCookie :: cookie_id ( ) ; let mut cookies = request . cookies ( ) ; match cookies . get_private ( cid ) { Some ( cookie ) => { if let Some ( cookie_deserialized ) = AdministratorCookie :: retrieve_cookie ( cookie . value ( ) . to_string ( ) ) { Outcome :: Success ( cookie_deserialized ) } else { Outcome :: Forward ( ( ) ) } } , None => Outcome :: Forward ( ( ) ) } }
The from_request inside the file defining the custom data types
enables the type to be checked directly in a route as a request guard
The from_request inside the file defining the custom data types enables the type to be checked directly in a route as a request guard
request
&'a Request<'r>
request
&'a Request<'r>