pub struct ChapterPassage { /* private fields */ }Expand description
A passage covering one chapter or an inclusive range of chapters.
Implementations§
Source§impl ChapterPassage
impl ChapterPassage
Sourcepub const fn new(
book: Book,
start_chapter: u16,
end_chapter: Option<u16>,
) -> Result<ChapterPassage, PassageBuildError>
pub const fn new( book: Book, start_chapter: u16, end_chapter: Option<u16>, ) -> Result<ChapterPassage, PassageBuildError>
Construct a validated chapter or chapter-range passage.
Sourcepub const fn single(
book: Book,
chapter: u16,
) -> Result<ChapterPassage, PassageBuildError>
pub const fn single( book: Book, chapter: u16, ) -> Result<ChapterPassage, PassageBuildError>
Construct a validated single-chapter passage.
Sourcepub const fn range(
book: Book,
start_chapter: u16,
end_chapter: u16,
) -> Result<ChapterPassage, PassageBuildError>
pub const fn range( book: Book, start_chapter: u16, end_chapter: u16, ) -> Result<ChapterPassage, PassageBuildError>
Construct a validated inclusive chapter range.
Sourcepub const fn start_chapter(self) -> u16
pub const fn start_chapter(self) -> u16
Return the first represented chapter.
Sourcepub const fn end_chapter(self) -> Option<u16>
pub const fn end_chapter(self) -> Option<u16>
Return the inclusive last chapter for a range, or None for one chapter.
Trait Implementations§
Source§impl Clone for ChapterPassage
impl Clone for ChapterPassage
Source§fn clone(&self) -> ChapterPassage
fn clone(&self) -> ChapterPassage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ChapterPassage
Source§impl Debug for ChapterPassage
impl Debug for ChapterPassage
Source§impl Display for ChapterPassage
impl Display for ChapterPassage
impl Eq for ChapterPassage
Source§impl From<ChapterPassage> for Passage
impl From<ChapterPassage> for Passage
Source§fn from(passage: ChapterPassage) -> Passage
fn from(passage: ChapterPassage) -> Passage
Converts to this type from the input type.
Source§impl Hash for ChapterPassage
impl Hash for ChapterPassage
Source§impl MachineIdentifiers for ChapterPassage
impl MachineIdentifiers for ChapterPassage
Source§fn osis_identifier(&self) -> String
fn osis_identifier(&self) -> String
Encode this value as a case-sensitive OSIS identifier.
Source§fn usfm_identifier(&self) -> String
fn usfm_identifier(&self) -> String
Encode this value as a case-sensitive USFM identifier.
Source§impl PartialEq for ChapterPassage
impl PartialEq for ChapterPassage
impl StructuralPartialEq for ChapterPassage
Auto Trait Implementations§
impl Freeze for ChapterPassage
impl RefUnwindSafe for ChapterPassage
impl Send for ChapterPassage
impl Sync for ChapterPassage
impl Unpin for ChapterPassage
impl UnsafeUnpin for ChapterPassage
impl UnwindSafe for ChapterPassage
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.