Struct ZTXtChunk

pub struct ZTXtChunk { pub keyword: String, /* private fields */ }

Struct representing a zTXt chunk

Fields

keyword: String

Keyword field of the tEXt chunk. Needs to be between 1-79 bytes when encoded as Latin-1.

Implementations

impl ZTXtChunk

fn new(keyword: impl Into<String>, text: impl Into<String>) -> Self

Creates a new ZTXt chunk.

fn decompress_text(&mut self) -> Result<(), DecodingError>

Decompresses the inner text, mutating its own state. Can only handle decompressed text up to DECOMPRESSION_LIMIT bytes.

fn decompress_text_with_limit(&mut self, limit: usize) -> Result<(), DecodingError>

Decompresses the inner text, mutating its own state. Can only handle decompressed text up to limit bytes.

fn get_text(&self) -> Result<String, DecodingError>

Decompresses the inner text, and returns it as a String. If decompression uses more the 2MiB, first call decompress with limit, and then this method.

fn compress_text(&mut self) -> Result<(), EncodingError>

Compresses the inner text, mutating its own state.

Trait Implementations

impl Clone for ZTXtChunk

fn clone(&self) -> Self

impl Debug for ZTXtChunk

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl EncodableTextChunk for ZTXtChunk

fn encode<W: Write>(&self, w: &mut W) -> Result<(), EncodingError>

impl Eq for ZTXtChunk

impl PartialEq for ZTXtChunk

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for ZTXtChunk

Auto Trait Implementations

impl Freeze for ZTXtChunk

impl RefUnwindSafe for ZTXtChunk

impl Send for ZTXtChunk

impl Sync for ZTXtChunk

impl Unpin for ZTXtChunk

impl UnsafeUnpin for ZTXtChunk

impl UnwindSafe for ZTXtChunk

Blanket Implementations

impl<T> Any for ZTXtChunk where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ZTXtChunk where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ZTXtChunk where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for ZTXtChunk where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for ZTXtChunk

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for ZTXtChunk where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for ZTXtChunk where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ZTXtChunk where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for ZTXtChunk where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>