pub enum CachePath {
Memory,
Path(String),
}Expand description
The path of a cache database.
Variants§
Memory
Stores the database in memory, wiping it on program exit.
Has the string representation of :memory:.
Path(String)
A filesystem/network/whatever path.
Implementations§
Source§impl<'de> CachePath
impl<'de> CachePath
pub fn deserialize<__D>(__deserializer: __D) -> Result<CachePath, __D::Error>where
__D: Deserializer<'de>,
Source§impl CachePath
impl CachePath
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
The cache’s path as a str.
If self is Self::Memory, returns :memory:.
§Examples
use url_cleaner_engine::glue::*;
assert_eq!(CachePath::Memory .as_str(), ":memory:");
assert_eq!(CachePath::Path( "abc.sqlite".into()).as_str(), "abc.sqlite");
assert_eq!(CachePath::Path("file://abc.sqlite".into()).as_str(), "file://abc.sqlite");Trait Implementations§
Source§impl<'de> Deserialize<'de> for CachePath
impl<'de> Deserialize<'de> for CachePath
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CachePath> for InnerCache
impl From<CachePath> for InnerCache
impl Eq for CachePath
impl StructuralPartialEq for CachePath
Auto Trait Implementations§
impl Freeze for CachePath
impl RefUnwindSafe for CachePath
impl Send for CachePath
impl Sync for CachePath
impl Unpin for CachePath
impl UnwindSafe for CachePath
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> 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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read more