pub struct Response<'req> {
pub body: Vec<u8>,
pub code: &'req str,
pub status: &'req str,
pub protocol: &'req str,
pub method: &'req str,
pub headers: HashMap<&'req str, String>,
pub cookies: Vec<Cookie<'req>>,
}Fields§
§body: Vec<u8>§code: &'req str§status: &'req str§protocol: &'req str§method: &'req str§headers: HashMap<&'req str, String>Implementations§
Source§impl<'req> Response<'req>
impl<'req> Response<'req>
Sourcepub fn new(
req: Rc<RefCell<Request<'req>>>,
session_manager: Arc<SessionManager>,
session_id: &mut Uuid,
) -> Self
pub fn new( req: Rc<RefCell<Request<'req>>>, session_manager: Arc<SessionManager>, session_id: &mut Uuid, ) -> Self
Constructs a default response based on the passed request.
Sourcepub fn serialize(&mut self) -> Vec<u8> ⓘ
pub fn serialize(&mut self) -> Vec<u8> ⓘ
Generates the serial data for an HTTP response using the object internal state
pub fn is_redirect(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'req> Freeze for Response<'req>
impl<'req> RefUnwindSafe for Response<'req>
impl<'req> Send for Response<'req>
impl<'req> Sync for Response<'req>
impl<'req> Unpin for Response<'req>
impl<'req> UnwindSafe for Response<'req>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more