Skip to main content

MockCaptureSession

Struct MockCaptureSession 

Source
pub struct MockCaptureSession(/* private fields */);
Expand description

A camera session the app started, as the test sees it. Its photos answer what the test gave, or that the session does not run; its recordings answer when they are stopped, writing nothing. Every clone is the same session.

Implementations§

Source§

impl MockCaptureSession

Source

pub fn camera(&self) -> Camera

Source

pub fn picked(&self) -> CameraFormat

The format the app picked.

Source

pub fn format(&self) -> CameraFormat

The format it runs in: the one picked, or the one of the session it joined.

Source

pub fn preview_layer(&self) -> Option<Arc<dyn CompositionLayer>>

The layer the preview shows on, among the outputs given.

Source

pub fn frame_reader(&self) -> Option<Arc<dyn VideoFrameReader>>

The reader the frames go to, among the outputs given.

Source

pub fn photo_size(&self) -> Option<Size>

The size photos are taken at, among the outputs given.

Source

pub fn movie_options(&self) -> Option<MovieOptions>

What recordings ask for, among the outputs given.

Source

pub fn recordings(&self) -> Vec<PathBuf>

The paths the app recorded to, in order.

Source

pub fn is_dropped(&self) -> bool

Source

pub fn set_rotation_angles(&self, preview: u32, capture: u32)

Reports preview and capture as its rotation angles from now on, as the system would have turned them with the device.

Source

pub fn answering_photo(&self, photo: Photo)

Answers each photo with photo from now on, while the session runs.

Source

pub fn set_state(&self, state: CaptureState)

Reports state from now on, as the system would have changed it.

Trait Implementations§

Source§

impl Clone for MockCaptureSession

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

Auto Trait Implementations§

§

impl !RefUnwindSafe for MockCaptureSession

§

impl !Send for MockCaptureSession

§

impl !Sync for MockCaptureSession

§

impl !UnwindSafe for MockCaptureSession

§

impl Forget for MockCaptureSession

§

impl Freeze for MockCaptureSession
where *const RcInner<SessionShared> is !null: Freeze, PhantomData<RcInner<SessionShared>>: Freeze,

§

impl Move for MockCaptureSession

§

impl Unpin for MockCaptureSession
where Rc<SessionShared>: Unpin,

§

impl UnsafeUnpin for MockCaptureSession
where *const RcInner<SessionShared> is !null: UnsafeUnpin, PhantomData<RcInner<SessionShared>>: UnsafeUnpin,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>