Skip to main content

Req

Struct Req 

Source
pub struct Req<'a> { /* private fields */ }
Expand description

Rust proxy for the C req struct. Its methods provide getters and setters for various fields that control how the client request is processed by Varnish.

Implementations§

Source§

impl Req<'_>

Source

pub fn hash_always_miss(&self) -> bool

Return whether this request bypasses the cache lookup and is always treated as a miss.

Equivalent to req.hash_always_miss in VCL.

Source

pub fn set_hash_always_miss(&mut self, val: bool)

Force this request to be treated as a cache miss, skipping any existing cached object.

Equivalent to setting req.hash_always_miss in VCL.

Source

pub fn hash_ignore_busy(&self) -> bool

Return whether this request ignores busy (locked) cache objects and fetches from the backend instead of waiting.

Equivalent to req.hash_ignore_busy in VCL.

Source

pub fn set_hash_ignore_busy(&mut self, val: bool)

Make this request skip waiting on busy cache objects and go straight to the backend.

Equivalent to setting req.hash_ignore_busy in VCL.

Source

pub fn hash_ignore_vary(&self) -> bool

Return whether this request ignores Vary headers during cache lookup.

Equivalent to req.hash_ignore_vary in VCL.

Source

pub fn set_hash_ignore_vary(&mut self, val: bool)

Make this request ignore Vary headers during cache lookup, collapsing all variants into one cache key.

Equivalent to setting req.hash_ignore_vary in VCL.

Trait Implementations§

Source§

impl<'a> Debug for Req<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Send for Req<'a>

§

impl<'a> !Sync for Req<'a>

§

impl<'a> !UnwindSafe for Req<'a>

§

impl<'a> Freeze for Req<'a>

§

impl<'a> RefUnwindSafe for Req<'a>

§

impl<'a> Unpin for Req<'a>

§

impl<'a> UnsafeUnpin for Req<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.