pub struct Preferences {
pub(crate) handle: NonNull<SvzPreferences>,
}Expand description
The per-tag display preferences: colors, axis sides, visibility and gaps that follow a tag type, and their JSON file. Outlives sessions.
Fields§
§handle: NonNull<SvzPreferences>The C handle; never null.
Implementations§
Source§impl Preferences
impl Preferences
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
An empty store.
§Errors
Error::AbiMismatch for a library of another interface version,
Error::OutOfMemory when it cannot allocate.
Sourcepub fn load(&mut self, json: &str, source: &str) -> Result<(), Error>
pub fn load(&mut self, json: &str, source: &str) -> Result<(), Error>
Replaces every entry with those of a preference file.
§Errors
Error::Library with the reason when the file is refused, leaving
the store as it was; Error::Nul when source holds a NUL.
Trait Implementations§
Source§impl Drop for Preferences
impl Drop for Preferences
impl Send for Preferences
Auto Trait Implementations§
impl !Sync for Preferences
impl Freeze for Preferences
impl RefUnwindSafe for Preferences
impl Unpin for Preferences
impl UnsafeUnpin for Preferences
impl UnwindSafe for Preferences
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