pub struct CachedValue { /* private fields */ }Expand description
Cached HTTP response or arbitrary byte payload with headers and timestamp metadata.
Implementations§
Source§impl CachedValue
Inherent constructors for CachedValue.
impl CachedValue
Inherent constructors for CachedValue.
Sourcepub fn new(
status_code: usize,
headers: Vec<(String, String)>,
body: Vec<u8>,
) -> Self
pub fn new( status_code: usize, headers: Vec<(String, String)>, body: Vec<u8>, ) -> Self
Creates a CachedValue with status code, headers, and body stamped with current epoch time.
§Arguments
usize- HTTP status code.Vec<(String, String)>- Response headers.Vec<u8>- Payload bytes.
§Returns
Self- Constructed cached value.
Source§impl CachedValue
impl CachedValue
pub fn get_status_code(&self) -> usize
pub fn get_mut_status_code(&mut self) -> &mut usize
pub fn set_status_code(&mut self, val: usize) -> &mut Self
pub fn get_headers(&self) -> &Vec<(String, String)>
pub fn get_mut_headers(&mut self) -> &mut Vec<(String, String)>
pub fn set_headers(&mut self, val: Vec<(String, String)>) -> &mut Self
pub fn get_body(&self) -> &Vec<u8> ⓘ
pub fn get_mut_body(&mut self) -> &mut Vec<u8> ⓘ
pub fn set_body(&mut self, val: Vec<u8>) -> &mut Self
pub fn get_stored_at_ms(&self) -> u64
pub fn get_mut_stored_at_ms(&mut self) -> &mut u64
pub fn set_stored_at_ms(&mut self, val: u64) -> &mut Self
Trait Implementations§
Source§impl Clone for CachedValue
impl Clone for CachedValue
Source§impl Debug for CachedValue
impl Debug for CachedValue
impl Eq for CachedValue
Source§impl PartialEq for CachedValue
impl PartialEq for CachedValue
impl StructuralPartialEq for CachedValue
Auto Trait Implementations§
impl Forget for CachedValue
impl Freeze for CachedValue
impl Move for CachedValue
impl RefUnwindSafe for CachedValue
impl Send for CachedValuewhere
RawVecInner: Send,
impl Sync for CachedValuewhere
RawVecInner: Sync,
impl Unpin for CachedValue
impl UnsafeUnpin for CachedValuewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for CachedValuewhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.