pub struct CameraAdapter { /* private fields */ }Expand description
The camera import source adapter, staging into staging_root.
Implementations§
Source§impl CameraAdapter
impl CameraAdapter
Sourcepub fn new(staging_root: impl Into<PathBuf>) -> Self
pub fn new(staging_root: impl Into<PathBuf>) -> Self
An adapter staging under staging_root. Reuse the same root across runs so an
interrupted import resumes instead of starting over.
Sourcepub fn objects_root(&self) -> PathBuf
pub fn objects_root(&self) -> PathBuf
The root SourceAdapter::extract scans.
Sourcepub fn receive(
&self,
device: &mut dyn CameraDevice,
) -> Result<CameraReceipt, CameraError>
pub fn receive( &self, device: &mut dyn CameraDevice, ) -> Result<CameraReceipt, CameraError>
Copy every object off device into the staging root.
Folders are skipped; every file is received whatever its format. A fatal error (the
connection or the local disk) returns Err and leaves what was staged in place for the
next run to resume. Any other error is recorded and the run moves on: a storage the camera
will not list in CameraReceipt::storage_failures, an object in
CameraReceipt::failures.
Trait Implementations§
Source§impl Clone for CameraAdapter
impl Clone for CameraAdapter
Source§fn clone(&self) -> CameraAdapter
fn clone(&self) -> CameraAdapter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CameraAdapter
impl Debug for CameraAdapter
Source§impl SourceAdapter for CameraAdapter
impl SourceAdapter for CameraAdapter
Source§fn extract(&self, parts: &[PathBuf]) -> Result<ExtractedImport, AdapterError>
fn extract(&self, parts: &[PathBuf]) -> Result<ExtractedImport, AdapterError>
Scan staged object roots (normally CameraReceipt::objects_root) into entries, sorted by
primary path. A camera carries no out-of-band metadata: every entry’s
ExtractedMetadata is empty and the files’ own EXIF is authoritative.
Source§fn provider(&self) -> ImportProvider
fn provider(&self) -> ImportProvider
Auto Trait Implementations§
impl Freeze for CameraAdapter
impl RefUnwindSafe for CameraAdapter
impl Send for CameraAdapter
impl Sync for CameraAdapter
impl Unpin for CameraAdapter
impl UnsafeUnpin for CameraAdapter
impl UnwindSafe for CameraAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more