pub struct ElementData {Show 15 fields
pub path: String,
pub element_type: ElementType,
pub document_type: DocumentType,
pub date: Date,
pub number_value: String,
pub number_display: String,
pub verbose_name: String,
pub heading: Option<String>,
pub chapeau: Option<String>,
pub proviso: Option<String>,
pub content: Option<String>,
pub continuation: Option<String>,
pub uslm_id: Option<String>,
pub uslm_uuid: Option<String>,
pub source_credits: Vec<SourceCredit>,
}Expand description
Metadata and content for a single element in a USLM document
This struct contains all the information about a legislative element, including its position in the document hierarchy, identification paths, display information, and text content.
§Path Systems
Each element has two types of paths:
-
Structural Path (
path): Includes all hierarchy elements, even non-USLM ones likeLevel. Example:uscode/title_26/subtitle_k/chapter_100/section_9834/level_1 -
USLM ID (
uslm_id): Official USLM identifier following standard format. Only present for elements in the USLM scheme. Example:/us/usc/t26/s9834/a/1
Combining the structural path with the date provides a unique identifier for any element across all versions of the document.
Fields§
§path: StringThe full structural path in the document for the element
This includes all structural elements like Level that may not be part of the USLM identifier. Note that combining this with the date field gives a unique identifier for the document For example:
uscode/title_26/subtitle_k/chapter_100/subchapter_c/section_9834/level_1
element_type: ElementTypeThe type of this element in the legislative hierarchy
document_type: DocumentTypeThe type of document this element belongs to
date: DateThe date this version of the document was published
number_value: StringThe raw number or identifier value (e.g., “174”, “a”, “1”)
number_display: StringThe formatted display version of the number (may include prefixes/suffixes)
verbose_name: StringA human-readable name for this element (e.g., “Section 174”)
heading: Option<String>The heading or title text of the element
chapeau: Option<String>The words at the start of the element that appear before any enumerated items
proviso: Option<String>A clause imposing a qualification, condition, or restriction
content: Option<String>The main text content of the element
continuation: Option<String>Text content that appears after all child elements
uslm_id: Option<String>The USLM-standard identifier path for this element
This follows the official USLM path format and excludes structural-only elements.
For example: /us/usc/t26/s1/a/1 or /us/pl/119-21/s1/a
This is computed according to USLM standards for elements that are part of the
USLM identifier scheme. If the XML provides an identifier attribute, it is
validated to match this generated path.
Structural-only elements like Level will have None here, as they are not part of the USLM identifier scheme.
uslm_uuid: Option<String>The USLM id attribute for an element
Takes the form of a UUID, not guaranteed to exist
source_credits: Vec<SourceCredit>Source credits and references for this element
Implementations§
Source§impl ElementData
impl ElementData
Sourcepub fn get_text_content(&self, field: TextContentField) -> Option<String>
pub fn get_text_content(&self, field: TextContentField) -> Option<String>
Trait Implementations§
Source§impl Clone for ElementData
impl Clone for ElementData
Source§fn clone(&self) -> ElementData
fn clone(&self) -> ElementData
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 ElementData
impl Debug for ElementData
Source§impl<'de> Deserialize<'de> for ElementData
impl<'de> Deserialize<'de> for ElementData
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>,
Source§impl Hash for ElementData
impl Hash for ElementData
Source§impl PartialEq for ElementData
impl PartialEq for ElementData
Source§fn eq(&self, other: &ElementData) -> bool
fn eq(&self, other: &ElementData) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ElementData
impl Serialize for ElementData
impl Eq for ElementData
impl StructuralPartialEq for ElementData
Auto Trait Implementations§
impl Freeze for ElementData
impl RefUnwindSafe for ElementData
impl Send for ElementData
impl Sync for ElementData
impl Unpin for ElementData
impl UnsafeUnpin for ElementData
impl UnwindSafe for ElementData
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more