pub struct ProfileDb { /* private fields */ }Expand description
An in-memory profile database keyed by format prefix.
Implementations§
Source§impl ProfileDb
impl ProfileDb
Sourcepub fn load_builtin() -> Result<Self, DecodeError>
pub fn load_builtin() -> Result<Self, DecodeError>
Load built-in profiles from the embedded data/profiles.json.
This is the canonical source of the 53 active (+1 speculative) format profiles derived from the C# reference implementation.
§Errors
Returns DecodeError::Profile if the embedded JSON cannot be parsed.
Sourcepub fn load_external<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<(), DecodeError>
pub fn load_external<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), DecodeError>
Load an external profiles.json file and merge its entries,
overriding any existing profiles by matching prefix.
§Errors
Returns DecodeError::Profile if the file cannot be read or parsed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProfileDb
impl RefUnwindSafe for ProfileDb
impl Send for ProfileDb
impl Sync for ProfileDb
impl Unpin for ProfileDb
impl UnsafeUnpin for ProfileDb
impl UnwindSafe for ProfileDb
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<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 more