pub struct Collection {
pub name: Option<String>,
pub profiles: IndexMap<ProfileId, Profile>,
pub recipes: RecipeTree,
}Expand description
A collection of profiles, requests, etc. This is the primary Slumber unit of configuration.
Fields§
§name: Option<String>Descriptive name for the collection
profiles: IndexMap<ProfileId, Profile>Map of profiles, keyed by their unique IDs
recipes: RecipeTreeMap of requests and folders, keyed by their unique IDs. Folders allow for nested maps of more requests and folders. All IDs must be unique throughout the entire tree, not just at their level.
Implementations§
Source§impl Collection
impl Collection
Sourcepub fn load(path: &Path) -> Result<Self, CollectionError>
pub fn load(path: &Path) -> Result<Self, CollectionError>
Load collection from a file
Sourcepub fn parse(input: &str) -> Result<Self, CollectionError>
pub fn parse(input: &str) -> Result<Self, CollectionError>
Load collection from a YAML string
Source§impl Collection
impl Collection
Sourcepub fn default_profile(&self) -> Option<&Profile>
pub fn default_profile(&self) -> Option<&Profile>
Get the profile marked as default: true, if any. At most one profile
can be marked as default.
Trait Implementations§
Source§impl Debug for Collection
impl Debug for Collection
Source§impl Default for Collection
impl Default for Collection
Source§fn default() -> Collection
fn default() -> Collection
Returns the “default value” for a type. Read more
Source§impl DeserializeYaml for Collection
impl DeserializeYaml for Collection
Source§fn deserialize(yaml: SourcedYaml<'_>, source_map: &SourceMap) -> Result<Self>
fn deserialize(yaml: SourcedYaml<'_>, source_map: &SourceMap) -> Result<Self>
Deserialize the given YAML value into this type
Auto Trait Implementations§
impl Freeze for Collection
impl RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl UnsafeUnpin for Collection
impl UnwindSafe for Collection
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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