pub struct BibleChapterRange { /* private fields */ }Expand description
A Bible Chapter range is a range of Bible chapters, e.g. Genesis 1 to Genesis 2. It is represented by two BibleChapterReferences. The first chapter is the start of the range and the second chapter is the end of the range.
Implementations§
Source§impl BibleChapterRange
impl BibleChapterRange
Sourcepub fn new(
start: BibleChapterReference,
end: BibleChapterReference,
) -> Result<Self, BibleReferenceValidationError>
pub fn new( start: BibleChapterReference, end: BibleChapterReference, ) -> Result<Self, BibleReferenceValidationError>
Creates a new BibleChapterRange with the given start and end chapters, if the start chapter is before the end chapter. If the start chapter is after the end chapter, an error will be returned.
§Parameters
start: The start of the rangeend: The end of the range
Sourcepub fn start(&self) -> BibleChapterReference
pub fn start(&self) -> BibleChapterReference
Returns the start of the range
Sourcepub fn end(&self) -> BibleChapterReference
pub fn end(&self) -> BibleChapterReference
Returns the end of the range
Sourcepub fn as_list(&self) -> BibleChapterList
pub fn as_list(&self) -> BibleChapterList
Returns the range as a BibleChapterList
Sourcepub fn as_verse_range(&self) -> BibleVerseRange
pub fn as_verse_range(&self) -> BibleVerseRange
Downcasts the BibleChapterRange to a BibleVerseRange The first verse for the start chapter is assumed, and the last verse for the end chapter is assumed.
Sourcepub fn as_book_range(&self) -> Option<BibleBookRange>
pub fn as_book_range(&self) -> Option<BibleBookRange>
Tries to convert the range into a BibleBookRange if the range spans multiple books completely. Returns None if the range does not span over multiple books.
Sourcepub fn as_single_chapter(&self) -> Option<BibleChapterReference>
pub fn as_single_chapter(&self) -> Option<BibleChapterReference>
Converts the range into a BibleChapterReference if the range spans a single chapter. Returns None if the range does not span over a single chapter.
Trait Implementations§
Source§impl Clone for BibleChapterRange
impl Clone for BibleChapterRange
Source§fn clone(&self) -> BibleChapterRange
fn clone(&self) -> BibleChapterRange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BibleChapterRange
impl Debug for BibleChapterRange
impl Eq for BibleChapterRange
Source§impl Ord for BibleChapterRange
impl Ord for BibleChapterRange
Source§fn cmp(&self, other: &BibleChapterRange) -> Ordering
fn cmp(&self, other: &BibleChapterRange) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BibleChapterRange
impl PartialEq for BibleChapterRange
Source§fn eq(&self, other: &BibleChapterRange) -> bool
fn eq(&self, other: &BibleChapterRange) -> bool
self and other values to be equal, and is used by ==.