Catalog

Struct Catalog 

Source
pub struct Catalog {
    pub version: String,
    pub catalog_version: CatalogVersion,
    pub root_keyword_id: LrId,
    /* private fields */
}
Expand description

Catalog is the main container for Lightroom. It represents the .lrcat database.

Fields§

§version: String

The version string

§catalog_version: CatalogVersion

The catalog version

§root_keyword_id: LrId

Id for the root (top level) keyword

Implementations§

Source§

impl Catalog

Source

pub fn new<P>(path: P) -> Catalog
where P: AsRef<Path>,

Create a new catalog.

Source

pub fn open(&mut self) -> Result<()>

Open catalog. Return false in failure. This doesn’t check if the content is valid beyond the backing sqlite3.

Source

pub fn load_version(&mut self)

Load version info for the catalog.

Source

pub fn load_keywords_tree(&mut self) -> KeywordTree

Load a keyword tree

Source

pub fn load_keywords(&mut self) -> &BTreeMap<LrId, Keyword>

Load keywords.

Source

pub fn keywords(&self) -> &BTreeMap<LrId, Keyword>

Get the keywords. This assume the keywords have been loaded first. This allow non-mutable borrowing that would be caused by load_keywords().

Source

pub fn load_folders(&mut self) -> &Folders

Load folders.

Source

pub fn folders(&self) -> &Folders

Get the folders. This assume the folders have been loaded first. This allow non-mutable borrowing that would be caused by load_folders().

Source

pub fn load_library_files(&mut self) -> &Vec<LibraryFile>

Load library files (that back images)

Source

pub fn libfiles(&self) -> &Vec<LibraryFile>

Get the libfiles. This assume the libfiles have been loaded first. This allow non-mutable borrowing that would be caused by load_libfiles().

Source

pub fn load_images(&mut self) -> &Vec<Image>

Load images.

Source

pub fn images(&self) -> &Vec<Image>

Get the images. This assume the images have been loaded first. This allow non-mutable borrowing that would be caused by load_images().

Source

pub fn load_collections(&mut self) -> &Vec<Collection>

Load collectons.

Source

pub fn collections(&self) -> &Vec<Collection>

Get the collections. This assume the collections have been loaded first. This allow non-mutable borrowing that would be caused by load_collections().

Source

pub fn images_for_collection(&self, collection_id: LrId) -> Result<Vec<LrId>>

Return the of images in the given collection. Not to be confused with Content.

Auto Trait Implementations§

§

impl !Freeze for Catalog

§

impl !RefUnwindSafe for Catalog

§

impl Send for Catalog

§

impl !Sync for Catalog

§

impl Unpin for Catalog

§

impl !UnwindSafe for Catalog

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.