pub struct ChapterInfoBuilder { /* private fields */ }Expand description
Builder for constructing ChapterInfo.
§Examples
use ff_format::chapter::ChapterInfo;
use ff_format::Rational;
use std::time::Duration;
let chapter = ChapterInfo::builder()
.id(2)
.title("Act I")
.start(Duration::from_secs(120))
.end(Duration::from_secs(480))
.time_base(Rational::new(1, 1000))
.build();
assert_eq!(chapter.title(), Some("Act I"));
assert_eq!(chapter.duration(), Duration::from_secs(360));Implementations§
Source§impl ChapterInfoBuilder
impl ChapterInfoBuilder
Sourcepub fn metadata(self, metadata: HashMap<String, String>) -> Self
pub fn metadata(self, metadata: HashMap<String, String>) -> Self
Sets the chapter metadata (tags other than “title”).
Sourcepub fn build(self) -> ChapterInfo
pub fn build(self) -> ChapterInfo
Builds the ChapterInfo.
Trait Implementations§
Source§impl Clone for ChapterInfoBuilder
impl Clone for ChapterInfoBuilder
Source§fn clone(&self) -> ChapterInfoBuilder
fn clone(&self) -> ChapterInfoBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChapterInfoBuilder
impl Debug for ChapterInfoBuilder
Source§impl Default for ChapterInfoBuilder
impl Default for ChapterInfoBuilder
Source§fn default() -> ChapterInfoBuilder
fn default() -> ChapterInfoBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChapterInfoBuilder
impl RefUnwindSafe for ChapterInfoBuilder
impl Send for ChapterInfoBuilder
impl Sync for ChapterInfoBuilder
impl Unpin for ChapterInfoBuilder
impl UnsafeUnpin for ChapterInfoBuilder
impl UnwindSafe for ChapterInfoBuilder
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