[][src]Struct img_parts::jpeg::JpegSegment

pub struct JpegSegment { /* fields omitted */ }

The representation of a segment making up a Jpeg

Implementations

impl JpegSegment[src]

pub fn new(marker: u8) -> JpegSegment[src]

Construct an empty JpegSegment

pub fn new_with_contents(marker: u8, contents: Bytes) -> JpegSegment[src]

Construct a JpegSegment with contents

pub fn new_with_entropy(
    marker: u8,
    contents: Bytes,
    entropy: Bytes
) -> JpegSegment
[src]

Construct a JpegSegment with contents and entropy

pub fn len(&self) -> usize[src]

Get the size of this JpegSegment once it is encoded, entropy excluded.

The size is the sum of:

  • The marker (2 bytes).
  • The length (2 bytes) if this marker has a length.
  • The size of the content.

pub fn len_with_entropy(&self) -> usize[src]

Get the size of this JpegSegment once it is encoded, including the Entropy.

The size is the sum of:

  • The marker (2 bytes).
  • The length (2 bytes) if this marker has a length.
  • The size of the content.
  • The size of the encoded entropy data.

pub fn marker(&self) -> u8[src]

Get the second byte of the marker of this JpegSegment

pub fn contents(&self) -> &Bytes[src]

Get the content of this JpegSegment

pub fn has_entropy(&self) -> bool[src]

Check if this JpegSegment has entropy

pub fn encoder(self) -> ImageEncoder<Self>

Notable traits for ImageEncoder<I>

impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
[src]

Create an encoder for this JpegSegment

Trait Implementations

impl Clone for JpegSegment[src]

impl Debug for JpegSegment[src]

impl PartialEq<JpegSegment> for JpegSegment[src]

impl StructuralPartialEq for JpegSegment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.