pub struct PngMetadata { /* private fields */ }Expand description
The text entries of a PNG file (matplotlib’s PNG metadata): any
keywords, PNG’s own being Title, Author, Description,
Copyright, Creation Time, Software, Disclaimer, Warning,
Source and Comment. They are written in order as tEXt chunks, or
as iTXt chunks when the text is not Latin-1, as Pillow writes them.
matplotlib merges the metadata dictionary over its default
Software entry and leaves out the keys set to None;
PngMetadata::with and PngMetadata::without do the same.
use pltrs_render::PngMetadata;
// matplotlib's `metadata={"Title": "Signal", "Software": None}`.
let png = PngMetadata::default().with("Title", "Signal").without("Software");
assert_eq!(png.entries(), [("Title".to_owned(), "Signal".to_owned())]);
let defaults = PngMetadata::default();
assert_eq!(defaults.entries()[0].0, "Software");Implementations§
Source§impl PngMetadata
impl PngMetadata
Sourcepub fn with(self, keyword: impl Into<String>, text: impl Into<String>) -> Self
pub fn with(self, keyword: impl Into<String>, text: impl Into<String>) -> Self
These entries with keyword set to text: in place when the
keyword has an entry, else as a new last entry (a key of
matplotlib’s metadata).
Trait Implementations§
Source§impl Clone for PngMetadata
impl Clone for PngMetadata
Source§impl Debug for PngMetadata
impl Debug for PngMetadata
Source§impl Default for PngMetadata
impl Default for PngMetadata
Source§fn default() -> Self
fn default() -> Self
The Software entry naming pltrs (PNG_SOFTWARE), as matplotlib
names itself.
impl Eq for PngMetadata
Source§impl PartialEq for PngMetadata
impl PartialEq for PngMetadata
impl StructuralPartialEq for PngMetadata
Auto Trait Implementations§
impl Forget for PngMetadata
impl Freeze for PngMetadata
impl Move for PngMetadata
impl RefUnwindSafe for PngMetadata
impl Send for PngMetadata
impl Sync for PngMetadata
impl Unpin for PngMetadata
impl UnsafeUnpin for PngMetadata
impl UnwindSafe for PngMetadata
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