Struct syntect_assets::assets_metadata::AssetsMetadata
source · pub struct AssetsMetadata { /* private fields */ }Implementations§
source§impl AssetsMetadata
impl AssetsMetadata
sourcepub fn load_from_folder(path: &Path) -> Result<Option<Self>, Error>
pub fn load_from_folder(path: &Path) -> Result<Option<Self>, Error>
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 syntect-assets 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<AssetsMetadata> for AssetsMetadata
impl PartialEq<AssetsMetadata> for AssetsMetadata
source§fn eq(&self, other: &AssetsMetadata) -> bool
fn eq(&self, other: &AssetsMetadata) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for AssetsMetadata
impl Serialize for AssetsMetadata
impl Eq for AssetsMetadata
impl StructuralEq for AssetsMetadata
impl StructuralPartialEq for AssetsMetadata
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.