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 id(self, id: i64) -> ChapterInfoBuilder
pub fn id(self, id: i64) -> ChapterInfoBuilder
Sets the chapter ID.
Sourcepub fn title(self, title: impl Into<String>) -> ChapterInfoBuilder
pub fn title(self, title: impl Into<String>) -> ChapterInfoBuilder
Sets the chapter title.
Sourcepub fn start(self, start: Duration) -> ChapterInfoBuilder
pub fn start(self, start: Duration) -> ChapterInfoBuilder
Sets the chapter start time.
Sourcepub fn end(self, end: Duration) -> ChapterInfoBuilder
pub fn end(self, end: Duration) -> ChapterInfoBuilder
Sets the chapter end time.
Sourcepub fn time_base(self, time_base: Rational) -> ChapterInfoBuilder
pub fn time_base(self, time_base: Rational) -> ChapterInfoBuilder
Sets the chapter time base.
Sourcepub fn metadata(self, metadata: HashMap<String, String>) -> ChapterInfoBuilder
pub fn metadata(self, metadata: HashMap<String, String>) -> ChapterInfoBuilder
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