pub struct BibleMetadata {Show 15 fields
pub source: Option<BibleSource>,
pub id: Option<String>,
pub description: Option<String>,
pub language_name: Option<String>,
pub language_code: Option<String>,
pub translation_name: Option<String>,
pub abbreviation: 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 attached to a loaded Bible instance.
Fields§
§source: Option<BibleSource>Optional nested source provenance.
id: Option<String>Stable edition ID.
description: Option<String>Translation description.
language_name: Option<String>Human-readable language name.
language_code: Option<String>ISO language code.
translation_name: Option<String>Translation display name.
abbreviation: Option<String>Translation abbreviation.
year: Option<i32>Optional publication year.
direction: TextDirectionHintText direction.
source_name: Option<String>Optional upstream source name.
copyright: Option<String>Optional content copyright.
license: Option<String>Optional content license.
canon: Option<String>Optional canon label.
version_date: Option<String>Optional ISO-8601 version date, preserved as text.
additional: Map<String, Value>Unknown metadata fields preserved across serialization.
Implementations§
Source§impl BibleMetadata
impl BibleMetadata
Sourcepub fn from_value(value: &Value) -> Result<Self, BibleDataFormatError>
pub fn from_value(value: &Value) -> Result<Self, BibleDataFormatError>
Parse a standalone metadata object.
Sourcepub fn from_document_value(
document: &Value,
supplied_source: Option<&BibleSource>,
) -> Result<Self, BibleDataFormatError>
pub fn from_document_value( document: &Value, supplied_source: Option<&BibleSource>, ) -> Result<Self, BibleDataFormatError>
Read metadata from a complete Bible document.
Values nested in metadata take precedence over legacy root values,
followed by an explicitly supplied source, an embedded source, and
inferred language fallbacks.
Sourcepub fn validate(&self, path: &str) -> Result<(), BibleDataFormatError>
pub fn validate(&self, path: &str) -> Result<(), BibleDataFormatError>
Validate optional identity, nested source, dates, and extensions.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Return this metadata as a JSON object.
Trait Implementations§
Source§impl Clone for BibleMetadata
impl Clone for BibleMetadata
Source§fn clone(&self) -> BibleMetadata
fn clone(&self) -> BibleMetadata
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 BibleMetadata
impl Debug for BibleMetadata
Source§impl Default for BibleMetadata
impl Default for BibleMetadata
Source§fn default() -> BibleMetadata
fn default() -> BibleMetadata
Source§impl<'de> Deserialize<'de> for BibleMetadata
impl<'de> Deserialize<'de> for BibleMetadata
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>,
impl Eq for BibleMetadata
Source§impl Hash for BibleMetadata
impl Hash for BibleMetadata
Source§impl PartialEq for BibleMetadata
impl PartialEq for BibleMetadata
Source§impl Serialize for BibleMetadata
impl Serialize for BibleMetadata
impl StructuralPartialEq for BibleMetadata
Auto Trait Implementations§
impl Freeze for BibleMetadata
impl RefUnwindSafe for BibleMetadata
impl Send for BibleMetadata
impl Sync for BibleMetadata
impl Unpin for BibleMetadata
impl UnsafeUnpin for BibleMetadata
impl UnwindSafe for BibleMetadata
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
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
key and return true if they are equal.