pub struct Folder {
pub id: FolderId,
pub name: String,
pub parent_id: Option<FolderId>,
pub description: Option<String>,
pub created_at: DateTime<Utc>,
pub modified_at: DateTime<Utc>,
/* private fields */
}Expand description
A hierarchical folder for organizing clips.
Fields§
§id: FolderIdUnique identifier.
name: StringFolder name.
parent_id: Option<FolderId>Parent folder ID.
description: Option<String>Optional description.
created_at: DateTime<Utc>Creation timestamp.
modified_at: DateTime<Utc>Last modified timestamp.
Implementations§
Source§impl Folder
impl Folder
Sourcepub fn new_child(name: impl Into<String>, parent_id: FolderId) -> Self
pub fn new_child(name: impl Into<String>, parent_id: FolderId) -> Self
Creates a new child folder.
Sourcepub fn remove_clip(&mut self, clip_id: &ClipId) -> bool
pub fn remove_clip(&mut self, clip_id: &ClipId) -> bool
Removes a clip from the folder.
Sourcepub fn add_child_folder(&mut self, folder_id: FolderId) -> bool
pub fn add_child_folder(&mut self, folder_id: FolderId) -> bool
Adds a child folder.
Sourcepub fn remove_child_folder(&mut self, folder_id: &FolderId) -> bool
pub fn remove_child_folder(&mut self, folder_id: &FolderId) -> bool
Removes a child folder.
Sourcepub fn child_folders(&self) -> Vec<FolderId>
pub fn child_folders(&self) -> Vec<FolderId>
Returns all child folder IDs.
Sourcepub fn clip_count(&self) -> usize
pub fn clip_count(&self) -> usize
Returns the number of clips in the folder.
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
Returns the number of child folders.
Sourcepub fn set_description(&mut self, description: impl Into<String>)
pub fn set_description(&mut self, description: impl Into<String>)
Sets the description.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Folder
impl<'de> Deserialize<'de> for Folder
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Folder
impl RefUnwindSafe for Folder
impl Send for Folder
impl Sync for Folder
impl Unpin for Folder
impl UnsafeUnpin for Folder
impl UnwindSafe for Folder
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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