[−][src]Struct cloudflare_soos::Scans
Key positions in a progressive image file
cloudflare_soos::Scans::from_file(&input_file)?.cf_priority_change_headers()?;
Fields
metadata_end: Option<usize>Byte position where metadata ends. This many bytes are preceeding start of pixel data. It's usually <200 bytes, unless the image has color profiles or other bloat.
first_scan_end: Option<usize>Byte position where the first (lowest-quality) progressive scan ends. This many bytes are needed to display anything on screen. It's usually 12-15% of the file size.
good_scan_end: Option<usize>Byte position where most of ok-quality pixel data ends. This many bytes are needed to display a good-enough image. It's usually about 50% of the file size.
file_size: usizeSize of the whole image file, in bytes
Implementations
impl Scans[src]
pub fn from_file(input_file: &[u8]) -> Result<Self>[src]
Analyze an image file to find byte ranges of its metadata and progressive scans
impl Scans[src]
pub fn cf_priority_change_headers(&self) -> Result<(String, String)>[src]
Assumes the priorities are:
- 50 = critical js/css, fonts + image metadata
- 30 = regular js/css, followed by other images + JPEG DC
- 20 = low-priority image bodies
- 10 = idle
Returns cf-priority and cf-priority-change header values, respectively.
Trait Implementations
impl Clone for Scans[src]
impl Debug for Scans[src]
impl Default for Scans[src]
impl PartialEq<Scans> for Scans[src]
impl StructuralPartialEq for Scans[src]
Auto Trait Implementations
impl RefUnwindSafe for Scans[src]
impl Send for Scans[src]
impl Sync for Scans[src]
impl Unpin for Scans[src]
impl UnwindSafe for Scans[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,