pub struct LibrarySettings {
pub excluded_item_ids: Vec<String>,
}Expand description
Library browsing preferences.
Currently a single list: the folders (or whole libraries) the user has asked
to keep out of browsing. It is a list of ids, never names — names are
unstable, locale-dependent and non-unique, and the hardcoded name filter this
setting replaced broke on exactly that. What the ids then hide is decided in
repository::exclusions; this struct is only how the choice is carried and
persisted.
The default is an empty list: nobody inherits another user’s folder layout.
TRACES: UR-076 | DR-209
Fields§
§excluded_item_ids: Vec<String>Stable item ids of the folders/libraries hidden from browsing.
#[serde(default)] so settings JSON persisted before this field existed
loads as the previous behaviour (nothing hidden).
Implementations§
Source§impl LibrarySettings
impl LibrarySettings
Sourcepub fn sanitised(self) -> Self
pub fn sanitised(self) -> Self
Drop blanks and duplicates from the id list.
Applied on the way in from IPC and on the way out of the database, so a hand-edited or half-written value cannot make the list grow without bound or carry an empty id (which would match nothing but still be shown as a selection in the picker).
TRACES: UR-076 | DR-209
Trait Implementations§
Source§impl Clone for LibrarySettings
impl Clone for LibrarySettings
Source§fn clone(&self) -> LibrarySettings
fn clone(&self) -> LibrarySettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LibrarySettings
impl Debug for LibrarySettings
Source§impl Default for LibrarySettings
impl Default for LibrarySettings
Source§fn default() -> LibrarySettings
fn default() -> LibrarySettings
Source§impl<'de> Deserialize<'de> for LibrarySettings
impl<'de> Deserialize<'de> for LibrarySettings
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>,
Source§impl NamedType for LibrarySettings
impl NamedType for LibrarySettings
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
Source§impl PartialEq for LibrarySettings
impl PartialEq for LibrarySettings
Source§fn eq(&self, other: &LibrarySettings) -> bool
fn eq(&self, other: &LibrarySettings) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for LibrarySettings
impl Serialize for LibrarySettings
Source§impl Type for LibrarySettings
impl Type for LibrarySettings
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
definition will be put into the type map.impl Eq for LibrarySettings
impl Flatten for LibrarySettings
impl StructuralPartialEq for LibrarySettings
Auto Trait Implementations§
impl Freeze for LibrarySettings
impl RefUnwindSafe for LibrarySettings
impl Send for LibrarySettings
impl Sync for LibrarySettings
impl Unpin for LibrarySettings
impl UnsafeUnpin for LibrarySettings
impl UnwindSafe for LibrarySettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FunctionArg for Twhere
T: Type,
impl<T> FunctionArg for Twhere
T: Type,
§fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
DataType]. Read more