Skip to main content

Camera

Struct Camera 

Source
pub struct Camera {
    pub make: Option<String>,
    pub model: Option<String>,
    pub lens: Option<String>,
    pub exposure: Option<(u32, u32)>,
    pub f_number: Option<f64>,
    pub iso: Option<u32>,
    pub focal_length_mm: Option<f64>,
    pub taken: Option<Taken>,
    pub location: Option<Location>,
}
Expand description

The EXIF a person cares about, as plain values.

Fields§

§make: Option<String>

Make as written — often in capitals (FUJIFILM).

§model: Option<String>

Model as written — sometimes repeats the make (Canon EOS R5), sometimes does not (X-T5). Camera::body reconciles the two.

§lens: Option<String>§exposure: Option<(u32, u32)>

Exposure time as the camera’s own fraction, so 1/500 stays 1/500 rather than going through a float and coming back as 1/499.

§f_number: Option<f64>§iso: Option<u32>§focal_length_mm: Option<f64>§taken: Option<Taken>

When the shutter was pressed, in the camera’s own clock — EXIF usually has no time zone, and inventing one would be a claim this crate has no basis for.

§location: Option<Location>

Implementations§

Source§

impl Camera

Source

pub fn is_empty(&self) -> bool

Whether there is anything at all to show under “Camera”.

Source

pub fn body(&self) -> Option<String>

The camera, the way a person names it: “Fujifilm X-T5”, “Canon EOS R5” — never “FUJIFILM X-T5” or “Canon Canon EOS R5”.

Makers disagree about whether the model repeats the brand, so the brand (the make’s first word) is added only when the model does not already start with it. A make written in capitals is title-cased when it is a word rather than an initialism.

Source

pub fn exposure_line(&self) -> Option<String>

“1/500 · f/2 · ISO 160” — whichever of the three are known.

Source

pub fn summary(&self) -> Option<String>

One line for a status bar: “X-T5 · 23mm f/2 · 1/500 · ISO 160”.

The model alone, not Camera::body: the bar is short, and the brand is the part a person already knows.

Trait Implementations§

Source§

impl Clone for Camera

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Camera

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Camera

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Camera

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Camera

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.