pub struct ImageSegment {
pub src: String,
pub alt: String,
pub caption: String,
pub section: String,
pub section_level: u8,
}Expand description
An image extracted from a <figure> block in a Wikipedia article.
Wikipedia wraps images in <figure> elements containing an <img> and an
optional <figcaption>. Images appear between paragraphs, not inside them.
Fields§
§src: StringResolved URL of the image (thumbnail size as served by Wikimedia).
alt: StringAlt text from the <img alt="..."> attribute.
caption: StringPlain text of the <figcaption> element, if present.
section: StringThe section heading path at the point where the image appears.
section_level: u8The heading level of the current section (1–6). 0 if before any heading.
Trait Implementations§
Source§impl Clone for ImageSegment
impl Clone for ImageSegment
Source§fn clone(&self) -> ImageSegment
fn clone(&self) -> ImageSegment
Returns a duplicate of the value. Read more
1.0.0 · 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 ImageSegment
impl Debug for ImageSegment
Auto Trait Implementations§
impl Freeze for ImageSegment
impl RefUnwindSafe for ImageSegment
impl Send for ImageSegment
impl Sync for ImageSegment
impl Unpin for ImageSegment
impl UnsafeUnpin for ImageSegment
impl UnwindSafe for ImageSegment
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