pub struct AssetsMetadata { /* private fields */ }
Implementations§
Source§impl AssetsMetadata
impl AssetsMetadata
Sourcepub fn load_from_folder(path: &Path) -> Result<Option<Self>>
pub fn load_from_folder(path: &Path) -> Result<Option<Self>>
Load metadata about the stored cache file from the given folder.
There are several possibilities:
- We find a metadata.yaml file and are able to parse it => return the contained information
- We find a metadata.yaml file and but are not able to parse it => return a SerdeYamlError
- We do not find a metadata.yaml file but a syntaxes.bin or themes.bin file => assume that these were created by an old version of bat and return AssetsMetadata::default() without version information
- We do not find a metadata.yaml file and no cached assets => no user provided assets are available, return None
pub fn is_compatible_with(&self, current_version: &str) -> bool
Trait Implementations§
Source§impl Debug for AssetsMetadata
impl Debug for AssetsMetadata
Source§impl Default for AssetsMetadata
impl Default for AssetsMetadata
Source§fn default() -> AssetsMetadata
fn default() -> AssetsMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AssetsMetadata
impl<'de> Deserialize<'de> for AssetsMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AssetsMetadata
impl PartialEq for AssetsMetadata
Source§impl Serialize for AssetsMetadata
impl Serialize for AssetsMetadata
impl StructuralPartialEq for AssetsMetadata
Auto Trait Implementations§
impl Freeze for AssetsMetadata
impl RefUnwindSafe for AssetsMetadata
impl Send for AssetsMetadata
impl Sync for AssetsMetadata
impl Unpin for AssetsMetadata
impl UnwindSafe for AssetsMetadata
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