pub struct BibleSource {Show 15 fields
pub id: String,
pub asset_path: String,
pub language_name: String,
pub language_code: String,
pub translation_name: String,
pub abbreviation: String,
pub description: Option<String>,
pub year: Option<i32>,
pub direction: TextDirectionHint,
pub source_name: Option<String>,
pub copyright: Option<String>,
pub license: Option<String>,
pub canon: Option<String>,
pub version_date: Option<String>,
pub additional: Map<String, Value>,
}Expand description
Metadata for one loadable Bible source.
Fields§
§id: StringStable source/edition identifier.
asset_path: StringFile, asset, or URL path.
language_name: StringHuman-readable language name.
language_code: StringISO language code.
translation_name: StringHuman-readable translation name.
abbreviation: StringShort translation label.
description: Option<String>Optional description.
year: Option<i32>Optional publication year.
direction: TextDirectionHintText direction.
source_name: Option<String>Optional upstream source name.
copyright: Option<String>Optional content copyright statement.
license: Option<String>Optional content license identifier or URL.
canon: Option<String>Optional canon label.
version_date: Option<String>Optional ISO-8601 version date, preserved as text.
additional: Map<String, Value>Unknown source fields preserved across serialization.
Implementations§
Source§impl BibleSource
impl BibleSource
Sourcepub fn from_asset_path(asset_path: impl Into<String>) -> Self
pub fn from_asset_path(asset_path: impl Into<String>) -> Self
Derive conventional metadata from an asset path.
Sourcepub fn from_value(value: &Value) -> Result<Self, BibleDataFormatError>
pub fn from_value(value: &Value) -> Result<Self, BibleDataFormatError>
Parse a source object with aliases, inference, and path-aware errors.
Sourcepub fn from_json(input: &str) -> Result<Self, BibleDataFormatError>
pub fn from_json(input: &str) -> Result<Self, BibleDataFormatError>
Parse a source from JSON text.
Sourcepub fn validate(&self, path: &str) -> Result<(), BibleDataFormatError>
pub fn validate(&self, path: &str) -> Result<(), BibleDataFormatError>
Validate required fields, canonical identity, dates, and extensions.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Return this source as a JSON object.
Trait Implementations§
Source§impl Clone for BibleSource
impl Clone for BibleSource
Source§fn clone(&self) -> BibleSource
fn clone(&self) -> BibleSource
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 moreSource§impl Debug for BibleSource
impl Debug for BibleSource
Source§impl<'de> Deserialize<'de> for BibleSource
impl<'de> Deserialize<'de> for BibleSource
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
Source§impl Display for BibleSource
impl Display for BibleSource
impl Eq for BibleSource
Source§impl Hash for BibleSource
impl Hash for BibleSource
Source§impl PartialEq for BibleSource
impl PartialEq for BibleSource
Source§impl Serialize for BibleSource
impl Serialize for BibleSource
impl StructuralPartialEq for BibleSource
Auto Trait Implementations§
impl Freeze for BibleSource
impl RefUnwindSafe for BibleSource
impl Send for BibleSource
impl Sync for BibleSource
impl Unpin for BibleSource
impl UnsafeUnpin for BibleSource
impl UnwindSafe for BibleSource
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<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.