Struct MetricsReaderBuilder

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

Initialize and configure a MetricsReader but do not attach it to a running varnishd instance

Implementations§

Source§

impl<'a> MetricsReaderBuilder<'a>

Source

pub fn new() -> Self

Create a new VSCBuilder

Source

pub fn work_dir(self, dir: &Path) -> Result<Self, NulError>

Specify where to find the varnishd working directory.

It’s usually superfluous to call this function, unless varnishd itself was called with the -n argument (in which case, both arguments should match)

Source

pub fn patience(self, t: Option<Duration>) -> Self

How long to wait when attaching

When MetricsReaderBuilder::build() is called, it’ll internally call VSM_Attach, hoping to find a running varnishd instance. If None, the function will not return until it connects, otherwise it specifies the timeout to use.

Source

pub fn include(self, s: &str) -> Result<Self, NulError>

Provide a globbing pattern of statistics names to include.

May be called multiple times, interleaved with MetricsReaderBuilder::exclude(), the order matters.

Source

pub fn exclude(self, s: &str) -> Result<Self, NulError>

Provide a globbing pattern of statistics names to exclude.

May be called multiple times, interleaved with MetricsReaderBuilder::include(), the order matters.

Source

pub fn require(self, s: &str) -> Result<Self, NulError>

Provide a globbing pattern of statistics names to keep around, protecting them from exclusion.

Source

pub fn build(self) -> VclResult<MetricsReader<'a>>

Build the MetricsReader, attaching to a running varnishd instance

Trait Implementations§

Source§

impl Drop for MetricsReaderBuilder<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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.