CacheBuilder

Struct CacheBuilder 

Source
pub struct CacheBuilder { /* private fields */ }
Expand description

Builder struct for a tablet Cache.

This builder is only required for adding non-default include paths, use Cache::new() for a tablet cache that uses the defaults.

Implementations§

Source§

impl CacheBuilder

Source

pub fn new() -> Self

Create a new, empty, CacheBuilder without any include paths. This info is only needed where include paths need to be modified, for standard invocations use Cache::new().

The typical invocation is

let cache = CacheBuilder::new()
                .add_default_includes()
                .build()?;

The above example is equivalent to Cache::new().

Source

pub fn add_default_includes(self) -> Self

Add the default set of include paths as compiled in, typically:

  • /usr/share/libwacom,
  • /etc/libwacom
  • $XDG_CONFIG_HOME/libwacom.
Source

pub fn add_include(self, path: &Path) -> Self

Add an include path at the current position. Include paths are processed in-order with a file in most recent path obscuring a file with the same name in an earlier include path.

Include paths to not need to exist, empty or non-existing include paths are ignored.

Source

pub fn build(self) -> Result<Cache, Error>

Create a tablet Cache from the current include paths.

Trait Implementations§

Source§

impl Default for CacheBuilder

Source§

fn default() -> Self

Returns the “default value” for a 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.