### pub async fn start_camera_preview Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.start_camera_preview.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Starts continuous capture from a specified camera device for live preview. ```APIDOC ## Function: start_camera_preview ### Description Starts continuous capture from a camera (for live preview). ### Signature `pub async fn start_camera_preview(device_id: String, format: Option) -> Result` ### Parameters - **device_id** (String) - The identifier of the camera device to start. - **format** (Option) - Optional camera format configuration. ### Returns - **Result** - Returns a success string containing preview details or an error string if the operation fails. ``` -------------------------------- ### pub async fn start_camera_preview Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.start_camera_preview.html Starts continuous capture from a specified camera device for live preview purposes. ```APIDOC ## start_camera_preview ### Description Starts continuous capture from a camera (for live preview). ### Signature `pub async fn start_camera_preview(device_id: String, format: Option) -> Result` ### Parameters - **device_id** (String) - The identifier of the camera device to start. - **format** (Option) - Optional camera format configuration. ### Returns - **Result** - Returns a success string containing preview details or an error string if the operation fails. ``` -------------------------------- ### MockCamera::start_stream Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/struct.MockCamera.html?search=u32+-%3E+bool Starts the camera streaming process. ```APIDOC ## pub fn start_stream(&self) -> Result<(), CameraError> ### Description Initiates the camera stream. Returns an error if the stream cannot be started. ``` -------------------------------- ### MockCamera::start_stream Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/struct.MockCamera.html?search= Starts the camera stream. ```APIDOC ## pub fn start_stream(&self) -> Result<(), CameraError> ### Description Initiates the streaming process for the mock camera. ``` -------------------------------- ### Example Search Queries Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/struct.CaptureStats.html?search= Common search patterns for finding types and trait implementations. ```text std::vec u32 -> bool Option, (T -> U) -> Option ``` -------------------------------- ### DeviceMonitor::start_monitoring Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/device_monitor/struct.DeviceMonitor.html?search= Starts the monitoring process for camera device changes. ```APIDOC ### pub async fn start_monitoring(&self) -> Result<(), CameraError> Starts monitoring for device changes. Returns an error if the monitoring fails to start. ``` -------------------------------- ### DeviceMonitor::start_monitoring Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/device_monitor/struct.DeviceMonitor.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Starts the background process for monitoring camera device changes. ```APIDOC ### pub async fn start_monitoring(&self) -> Result<(), CameraError> Starts monitoring for device changes. Returns an error if the monitoring process fails to initialize. ``` -------------------------------- ### PlatformCamera::start_stream Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/enum.PlatformCamera.html?search= Starts the camera data stream. ```APIDOC ## pub fn start_stream(&mut self) -> Result<(), CameraError> ### Description Initiates the streaming process from the camera. ### Returns - **Result<(), CameraError>** - Returns Ok(()) on success or an error if the stream could not be started. ``` -------------------------------- ### start_camera_preview(device_id: String, format: Option) -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.start_camera_preview.html?search=u32+-%3E+bool Starts a continuous capture stream from the specified camera device. ```APIDOC ## Function: start_camera_preview ### Description Starts continuous capture from a camera for live preview purposes. ### Signature `pub async fn start_camera_preview(device_id: String, format: Option) -> Result` ### Parameters - **device_id** (String) - The identifier of the camera device to start. - **format** (Option) - Optional configuration for the camera capture format. ### Returns - **Result** - Returns a success string containing preview details, or an error string if the operation fails. ``` -------------------------------- ### start_device_monitoring function signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/device_monitor/fn.start_device_monitoring.html The function signature for starting device monitoring, returning a Result type. ```rust pub async fn start_device_monitoring() -> Result ``` -------------------------------- ### Example Search Queries Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/device_monitor/struct.DeviceEventInfo.html?search= Common search patterns used for finding types and functions within the documentation. ```text * std::vec * u32 -> bool * Option, (T -> U) -> Option ``` -------------------------------- ### start_camera_preview function signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.start_camera_preview.html The function signature for starting a camera preview, requiring a device ID and an optional camera format. ```rust pub async fn start_camera_preview( device_id: String, format: Option, ) -> Result ``` -------------------------------- ### Get current platform string signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.current_platform_string.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the current platform as a String for legacy compatibility. ```rust pub fn current_platform_string() -> String ``` -------------------------------- ### Get standard test formats Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.get_test_formats.html Retrieves a collection of standard CameraFormat instances for testing. ```rust pub fn get_test_formats() -> Vec ``` -------------------------------- ### setup_test_environment Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.setup_test_environment.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Initializes and returns a MockCameraSystem for use in test environments. ```APIDOC ## setup_test_environment ### Description Initializes a mock camera system for testing purposes. This function is asynchronous and returns a `MockCameraSystem` instance. ### Signature `pub async fn setup_test_environment() -> MockCameraSystem` ``` -------------------------------- ### setup_test_environment Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.setup_test_environment.html?search=std%3A%3Avec Initializes and returns a MockCameraSystem for use in test environments. ```APIDOC ## Function: setup_test_environment ### Description Initializes a mock camera system for testing purposes. This function is asynchronous. ### Signature `pub async fn setup_test_environment() -> MockCameraSystem` ### Returns - **MockCameraSystem** - An instance of the mock camera system configured for testing. ``` -------------------------------- ### Get current platform Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.current_platform.html Returns the current platform as a Platform enum. ```rust pub fn current_platform() -> Platform ``` -------------------------------- ### setup_test_environment Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.setup_test_environment.html?search=u32+-%3E+bool Initializes the test environment by returning a MockCameraSystem instance. ```APIDOC ## setup_test_environment ### Description Initializes the test environment and returns a `MockCameraSystem` instance for use in tests. ### Signature `pub async fn setup_test_environment() -> MockCameraSystem` ``` -------------------------------- ### pub async fn initialize_camera_system() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.initialize_camera_system.html?search=std%3A%3Avec Initializes the camera system for the current platform. Returns a Result containing a success message string or an error string. ```APIDOC ## initialize_camera_system ### Description Initializes the camera system for the current platform. ### Signature `pub async fn initialize_camera_system() -> Result` ### Returns - **Result** - Returns `Ok(String)` on success with a status message, or `Err(String)` if initialization fails. ``` -------------------------------- ### CameraSystem::initialize Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/struct.CameraSystem.html?search= Initializes the camera system for the current platform. ```APIDOC ## pub fn initialize() -> Result ### Description Initialize the camera system for the current platform. ### Returns - **Result** - A status string or a CameraError if initialization fails. ``` -------------------------------- ### pub async fn start_device_monitoring() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/device_monitor/fn.start_device_monitoring.html Initiates the device monitoring process. Returns a Result containing a success message or an error string. ```APIDOC ## start_device_monitoring ### Description Starts the device monitoring process. ### Signature `pub async fn start_device_monitoring() -> Result` ### Returns - **Result** - Returns `Ok(String)` on success or `Err(String)` if the monitoring fails to start. ``` -------------------------------- ### pub async fn start_device_monitoring() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/device_monitor/fn.start_device_monitoring.html?search=std%3A%3Avec Initiates the device monitoring process. Returns a Result containing a success message string or an error message string. ```APIDOC ## Function: start_device_monitoring ### Description Starts the device monitoring process. ### Signature `pub async fn start_device_monitoring() -> Result` ### Returns - **Result** - Returns `Ok(String)` on success or `Err(String)` if the monitoring fails to start. ``` -------------------------------- ### pub fn init() -> TauriPlugin Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Initializes the CrabCamera plugin with all commands for a Tauri runtime. ```APIDOC ## init ### Description Initializes the CrabCamera plugin with all commands for the provided Tauri runtime. ### Signature `pub fn init() -> TauriPlugin` ``` -------------------------------- ### pub fn init() -> TauriPlugin Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init.html?search=u32+-%3E+bool Initializes the CrabCamera plugin for a given Tauri runtime. ```APIDOC ## init ### Description Initializes the CrabCamera plugin with all commands. ### Signature `pub fn init() -> TauriPlugin` ``` -------------------------------- ### Get permission status string signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/permissions/fn.get_permission_status_string.html?search= Returns a String representing the current permission status. ```rust pub fn get_permission_status_string() -> String ``` -------------------------------- ### pub fn init() -> TauriPlugin Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init.html Initializes the CrabCamera plugin with all commands for the specified runtime. ```APIDOC ## init ### Description Initializes the CrabCamera plugin with all commands. This function is used to register the plugin within a Tauri application. ### Signature `pub fn init() -> TauriPlugin` ### Type Parameters - **R**: Runtime - The runtime type for the Tauri application. ``` -------------------------------- ### pub fn init_logging() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init_logging.html Initializes the logging system for the camera system. This function should be called during the application startup process. ```APIDOC ## init_logging ### Description Initializes logging for the camera system. ### Signature `pub fn init_logging()` ``` -------------------------------- ### get_system_diagnostics Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_system_diagnostics.html?search=std%3A%3Avec Retrieves detailed information about the camera system state, useful for debugging issues and verifying setup. ```APIDOC ## Function: get_system_diagnostics ### Description Retrieves detailed information about the camera system state, useful for debugging issues and verifying setup. ### Signature `pub async fn get_system_diagnostics() -> Result` ### Returns - **Result** - Returns a Result containing the SystemDiagnostics object on success, or a String error message on failure. ``` -------------------------------- ### fn init Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init.html?search=std%3A%3Avec Initializes the CrabCamera plugin with all available commands. ```APIDOC ## pub fn init() -> TauriPlugin ### Description Initializes the CrabCamera plugin with all commands for a Tauri application. ### Signature `pub fn init() -> TauriPlugin` ### Type Parameters - **R**: Runtime - The Tauri runtime type. ``` -------------------------------- ### pub fn init() -> TauriPlugin Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init.html?search= Initializes the CrabCamera plugin with all available commands for a Tauri application. ```APIDOC ## pub fn init() -> TauriPlugin ### Description Initializes the CrabCamera plugin with all commands. This function is intended to be used when setting up the Tauri application plugin system. ### Signature `pub fn init() -> TauriPlugin` ### Type Parameters - **R**: The runtime type, which must implement the `Runtime` trait. ``` -------------------------------- ### get_system_diagnostics() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_system_diagnostics.html?search= Retrieves detailed information about the camera system state, useful for debugging issues and verifying setup. ```APIDOC ## get_system_diagnostics ### Description Retrieves detailed information about the camera system state, useful for debugging issues and verifying setup. ### Signature `pub async fn get_system_diagnostics() -> Result` ### Returns - **Result** - Returns a Result containing the SystemDiagnostics object on success, or a String error message on failure. ``` -------------------------------- ### initialize_camera Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/index.html Initializes the camera on Linux using the V4L2 backend. ```APIDOC ## initialize_camera ### Description Initializes the camera on Linux with V4L2 backend. ### Signature `pub fn initialize_camera() -> Result` ``` -------------------------------- ### Get default focus stack configuration Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/focus_stack/fn.get_default_focus_config.html Retrieves the default FocusStackConfig object used by the focus stack command. ```rust pub fn get_default_focus_config() -> FocusStackConfig ``` -------------------------------- ### initialize_camera Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/index.html?search= Initializes the camera on Linux using the V4L2 backend. ```APIDOC ## initialize_camera ### Description Initializes the camera on Linux with V4L2 backend. ### Signature `pub fn initialize_camera() -> Result` ``` -------------------------------- ### initialize_camera_system Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.initialize_camera_system.html Initializes the camera system for the current platform. ```APIDOC ## initialize_camera_system ### Description Initializes the camera system for the current platform. ### Signature `pub async fn initialize_camera_system() -> Result` ### Returns - **Result** - Returns a success message string on success, or an error message string on failure. ``` -------------------------------- ### initialize_camera_system Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.initialize_camera_system.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Initializes the camera system for the current platform. ```APIDOC ## Function: initialize_camera_system ### Description Initializes the camera system for the current platform. ### Signature `pub async fn initialize_camera_system() -> Result` ### Returns - **Result**: Returns a success message string on success, or an error message string on failure. ``` -------------------------------- ### initialize_camera_system Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.initialize_camera_system.html?search=u32+-%3E+bool Initializes the camera system for the current platform. ```APIDOC ## Function: initialize_camera_system ### Description Initializes the camera system for the current platform. ### Signature `pub async fn initialize_camera_system() -> Result` ### Returns - **Result** - Returns a success message string on success, or an error message string on failure. ``` -------------------------------- ### initialize_camera_system Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/index.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Initializes the camera system for the current platform. ```APIDOC ### initialize_camera_system Initializes the camera system for the current platform. ``` -------------------------------- ### pub fn init_test_env() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.init_test_env.html?search=std%3A%3Avec Initializes the test environment. ```APIDOC ## Function: init_test_env ### Description Initializes the test environment for the crabcamera crate. ### Signature `pub fn init_test_env()` ``` -------------------------------- ### start_camera_preview Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.start_camera_preview.html?search=std%3A%3Avec Initiates a continuous camera preview stream for a specified device. ```APIDOC ## Function: start_camera_preview ### Description Starts continuous capture from a camera for live preview. ### Signature `pub async fn start_camera_preview(device_id: String, format: Option) -> Result` ### Parameters - **device_id** (String) - The identifier of the camera device to start. - **format** (Option) - Optional camera format configuration. ### Returns - **Result** - Returns a success string containing preview details or an error string if the operation fails. ``` -------------------------------- ### initialize_camera Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/index.html?search=std%3A%3Avec Initializes the camera on Linux systems using the V4L2 backend. ```APIDOC ## initialize_camera ### Description Initializes the camera on Linux with V4L2 backend. ``` -------------------------------- ### start_device_monitoring Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/device_monitor/fn.start_device_monitoring.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Initiates the device monitoring process. ```APIDOC ## start_device_monitoring ### Description Starts the device monitoring process. This is an asynchronous function. ### Signature `pub async fn start_device_monitoring() -> Result` ### Returns - **Result** - Returns `Ok(String)` on success or `Err(String)` if the monitoring fails to start. ``` -------------------------------- ### Initialize logging in Rust Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init_logging.html?search= Initializes the logging system for the camera system. ```rust pub fn init_logging() ``` -------------------------------- ### MockCameraSystem::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/struct.MockCameraSystem.html?search= Creates a new instance of the MockCameraSystem. ```APIDOC ## pub fn new() -> Self ### Description Creates a new instance of the MockCameraSystem for testing purposes. ``` -------------------------------- ### init_logging() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init_logging.html?search=std%3A%3Avec Initializes the logging system for the crabcamera crate. ```APIDOC ## fn init_logging() ### Description Initializes logging for the camera system. ### Signature `pub fn init_logging()` ``` -------------------------------- ### pub fn initialize_camera(params: CameraInitParams) -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/fn.initialize_camera.html Initializes a camera device on Linux using the V4L2 backend. This function takes initialization parameters and returns a LinuxCamera instance or a CameraError. ```APIDOC ## initialize_camera ### Description Initializes the camera on Linux systems utilizing the V4L2 backend. ### Signature `pub fn initialize_camera(params: CameraInitParams) -> Result` ### Parameters - **params** (CameraInitParams) - Required - The configuration parameters required to initialize the camera. ### Returns - **Result** - Returns a `LinuxCamera` object on success, or a `CameraError` if the initialization fails. ``` -------------------------------- ### setup_test_environment Function Signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.setup_test_environment.html Displays the asynchronous function signature for initializing the test environment. ```rust pub async fn setup_test_environment() -> MockCameraSystem ``` -------------------------------- ### pub async fn test_camera_system() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.test_camera_system.html Tests the camera system functionality and returns the result of the system test. ```APIDOC ## test_camera_system ### Description Tests the camera system functionality. ### Signature `pub async fn test_camera_system() -> Result` ### Returns - **Result** - Returns a `SystemTestResult` on success, or a `String` containing an error message if the test fails. ``` -------------------------------- ### pub async fn test_camera_system() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.test_camera_system.html?search= Tests the camera system functionality and returns a result indicating success or failure. ```APIDOC ## test_camera_system ### Description Tests the camera system functionality. ### Signature `pub async fn test_camera_system() -> Result` ### Returns - **Result** - Returns `Ok(SystemTestResult)` if the system test passes, or `Err(String)` containing an error message if the test fails. ``` -------------------------------- ### pub async fn test_camera_system() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.test_camera_system.html?search=std%3A%3Avec Tests the camera system functionality and returns a result indicating success or failure. ```APIDOC ## Function: test_camera_system ### Description Tests the camera system functionality. ### Signature `pub async fn test_camera_system() -> Result` ### Returns - **Result** - Returns `Ok(SystemTestResult)` if the system test passes, or `Err(String)` containing an error message if the test fails. ``` -------------------------------- ### pub async fn get_current_platform() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_current_platform.html Retrieves the current platform information as a string. ```APIDOC ## get_current_platform ### Description Retrieves the current platform information. Returns a Result containing the platform string on success, or an error message string on failure. ### Signature `pub async fn get_current_platform() -> Result` ### Returns - **Result** - Ok(String) containing the platform name on success, or Err(String) containing an error message. ``` -------------------------------- ### pub fn initialize_camera(params: CameraInitParams) -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/fn.initialize_camera.html?search= Initializes a camera on Linux using the V4L2 backend. It takes a CameraInitParams object and returns a Result containing a LinuxCamera instance or a CameraError. ```APIDOC ## initialize_camera ### Description Initializes the camera on Linux systems using the V4L2 backend. ### Signature `pub fn initialize_camera(params: CameraInitParams) -> Result` ### Parameters - **params** (CameraInitParams) - Required - The initialization parameters for the camera. ### Returns - **Result** - Returns a `LinuxCamera` instance on success, or a `CameraError` if initialization fails. ``` -------------------------------- ### PlatformCamera::start_stream Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/enum.PlatformCamera.html?search=std%3A%3Avec Initiates the camera stream. ```APIDOC ### pub fn start_stream(&mut self) -> Result<(), CameraError> Start camera stream. ``` -------------------------------- ### get_optimal_settings() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_optimal_settings.html?search= Retrieves the optimal camera initialization parameters. ```APIDOC ## Function: get_optimal_settings ### Description Retrieves the optimal camera settings required for high-quality capture operations. ### Signature `pub async fn get_optimal_settings() -> Result` ### Returns - **Result** - Returns a `CameraInitParams` object on success, or a `String` containing an error message if the operation fails. ``` -------------------------------- ### Initialize CrabCamera plugin Source: https://docs.rs/crabcamera/0.8.3/crabcamera/fn.init.html Initializes the plugin with the specified runtime. ```Rust pub fn init() -> TauriPlugin ``` -------------------------------- ### Retrieve photography format Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/optimizations/fn.get_photography_format.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the recommended CameraFormat for the current platform. ```rust pub fn get_photography_format() -> CameraFormat ``` -------------------------------- ### pub fn is_v4l2_available() -> bool Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/fn.is_v4l2_available.html Checks if the V4L2 subsystem is available on the host system. ```APIDOC ## Function: is_v4l2_available ### Description Checks if V4L2 (Video4Linux2) is available on the system. This function is used to determine if the platform supports V4L2-based camera operations. ### Signature `pub fn is_v4l2_available() -> bool` ### Returns - **bool**: Returns `true` if V4L2 is available, otherwise `false`. ``` -------------------------------- ### PlatformCamera::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/enum.PlatformCamera.html?search=std%3A%3Avec Creates a new instance of a platform camera using the provided initialization parameters. ```APIDOC ### pub fn new(params: CameraInitParams) -> Result Creates a new platform camera from initialization parameters. ``` -------------------------------- ### Retrieve Optimal Camera Settings Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/optimizations/fn.get_optimal_settings.html Returns the CameraInitParams struct containing platform-specific configuration for camera initialization. ```rust pub fn get_optimal_settings() -> CameraInitParams ``` -------------------------------- ### get_optimal_settings Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_optimal_settings.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the optimal camera initialization parameters. ```APIDOC ## Function: get_optimal_settings ### Description Retrieves optimal camera settings for high-quality capture. ### Signature `pub async fn get_optimal_settings() -> Result` ### Returns - **Result**: Returns a Result containing the `CameraInitParams` on success, or a `String` error message on failure. ``` -------------------------------- ### get_optimal_settings Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_optimal_settings.html?search=u32+-%3E+bool Retrieves the optimal camera initialization parameters. ```APIDOC ## Function: get_optimal_settings ### Description Retrieves optimal camera settings for high-quality capture. ### Signature `pub async fn get_optimal_settings() -> Result` ### Returns - **Result**: Returns a `CameraInitParams` object on success, or a `String` containing an error message if the operation fails. ``` -------------------------------- ### pub fn list_v4l2_devices() -> Result, CameraError> Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/fn.list_v4l2_devices.html?search= Lists all V4L2 devices found in the /dev/video* directory. ```APIDOC ## list_v4l2_devices ### Description Lists all V4L2 devices in /dev/video*. ### Signature `pub fn list_v4l2_devices() -> Result, CameraError>` ### Returns - **Result, CameraError>** - A vector of strings representing the paths to the detected V4L2 devices, or a CameraError if the operation fails. ``` -------------------------------- ### pub fn list_v4l2_devices() -> Result, CameraError> Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/fn.list_v4l2_devices.html?search=std%3A%3Avec Lists all V4L2 devices found in the /dev/video* directory. ```APIDOC ## list_v4l2_devices ### Description Lists all V4L2 devices in /dev/video*. ### Signature `pub fn list_v4l2_devices() -> Result, CameraError>` ### Returns - **Result, CameraError>** - A Result containing a vector of strings representing the device paths on success, or a CameraError on failure. ``` -------------------------------- ### PlatformCamera::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/enum.PlatformCamera.html Creates a new instance of a platform-specific camera using the provided initialization parameters. ```APIDOC ## pub fn new(params: CameraInitParams) -> Result ### Description Initializes a new platform camera based on the provided configuration parameters. ### Parameters - **params** (CameraInitParams) - Required - The initialization parameters for the camera. ### Returns - **Result** - Returns the initialized camera instance or an error if initialization fails. ``` -------------------------------- ### CameraDeviceInfo Methods Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraDeviceInfo.html?search=std%3A%3Avec Methods for creating and configuring a CameraDeviceInfo instance. ```APIDOC ## CameraDeviceInfo::new ### Description Creates a new instance of CameraDeviceInfo with the specified ID and name. ### Signature `pub fn new(id: String, name: String) -> Self` ## CameraDeviceInfo::with_description ### Description Sets the description for the camera device. ### Signature `pub fn with_description(self, description: String) -> Self` ## CameraDeviceInfo::with_formats ### Description Sets the supported formats for the camera device. ### Signature `pub fn with_formats(self, formats: Vec) -> Self` ## CameraDeviceInfo::with_availability ### Description Sets the availability status of the camera device. ### Signature `pub fn with_availability(self, available: bool) -> Self` ``` -------------------------------- ### DeviceMonitor::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/device_monitor/struct.DeviceMonitor.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of the DeviceMonitor. ```APIDOC ### pub fn new() -> Self Creates a new device monitor instance. ``` -------------------------------- ### pub fn list_cameras() -> Result, CameraError> Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/fn.list_cameras.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Lists all available camera devices on the Linux platform. ```APIDOC ## Function: list_cameras ### Description Lists available cameras on Linux systems. ### Signature `pub fn list_cameras() -> Result, CameraError>` ### Returns - **Result, CameraError>>**: Returns a Result containing a vector of `CameraDeviceInfo` objects on success, or a `CameraError` if the operation fails. ``` -------------------------------- ### pub fn list_cameras() -> Result, CameraError> Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/fn.list_cameras.html?search=u32+-%3E+bool Lists all available camera devices on the Linux platform. ```APIDOC ## list_cameras ### Description Lists available cameras on Linux. ### Signature `pub fn list_cameras() -> Result, CameraError>` ### Returns - **Result, CameraError>** - A Result containing a vector of CameraDeviceInfo objects on success, or a CameraError on failure. ``` -------------------------------- ### load_or_default Source: https://docs.rs/crabcamera/0.8.3/crabcamera/config/struct.CrabCameraConfig.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Attempts to load the configuration from the default location, returning a default configuration if the file is missing or invalid. ```APIDOC ## pub fn load_or_default() -> Self ### Description Loads the configuration from the default location or creates a new instance with default values. ### Returns - **Self** - The loaded or default CrabCameraConfig instance. ``` -------------------------------- ### CameraFrame::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraFrame.html?search=u32+-%3E+bool Creates a new instance of a CameraFrame. ```APIDOC ## CameraFrame::new ### Description Creates a new camera frame instance with the provided data, dimensions, and device identifier. ### Signature `pub fn new(data: Vec, width: u32, height: u32, device_id: String) -> Self` ``` -------------------------------- ### CameraFrame::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraFrame.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of a CameraFrame. ```APIDOC ## pub fn new(data: Vec, width: u32, height: u32, device_id: String) -> Self ### Description Creates a new camera frame with the provided raw data, dimensions, and device identifier. ### Parameters - **data** (Vec) - The raw frame data. - **width** (u32) - The width of the frame. - **height** (u32) - The height of the frame. - **device_id** (String) - The identifier of the camera device. ``` -------------------------------- ### pub fn list_v4l2_devices() -> Result, CameraError> Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/fn.list_v4l2_devices.html Retrieves a list of all V4L2 devices found in the /dev/video* directory. ```APIDOC ## list_v4l2_devices ### Description Lists all V4L2 devices available in /dev/video*. ### Signature `pub fn list_v4l2_devices() -> Result, CameraError>` ### Returns - **Result, CameraError>** - A vector of strings representing the paths to the detected V4L2 devices, or a CameraError if the operation fails. ``` -------------------------------- ### pub async fn reset_config() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/config/fn.reset_config.html Resets the configuration to default values and returns the new configuration or an error string. ```APIDOC ## reset_config ### Description Resets the application configuration to its default state. ### Signature `pub async fn reset_config() -> Result` ### Returns - **Result** - Returns a Result containing the default `CrabCameraConfig` on success, or a `String` containing an error message on failure. ``` -------------------------------- ### initialize_camera function signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/fn.initialize_camera.html The function signature for initializing a camera on Linux using V4L2 parameters. ```rust pub fn initialize_camera( params: CameraInitParams, ) -> Result ``` -------------------------------- ### Platform::current() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/enum.Platform.html Detects and returns the current operating system platform. ```APIDOC ## Platform::current() ### Description Detects the current platform the application is running on. ### Signature `pub fn current() -> Self` ### Returns - **Platform** - The detected platform (Windows, MacOS, Linux, or Unknown). ``` -------------------------------- ### Platform::current() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/enum.Platform.html?search=u32+-%3E+bool Detects and returns the current operating system platform. ```APIDOC ## Platform::current() ### Description Detects the current platform the application is running on. ### Signature `pub fn current() -> Self` ### Returns - **Self** (Platform) - The detected platform variant (Windows, MacOS, Linux, or Unknown). ``` -------------------------------- ### Platform::current() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/enum.Platform.html?search= Detects and returns the current operating system platform. ```APIDOC ## Platform::current() ### Description Detects the current platform the application is running on. ### Signature `pub fn current() -> Self` ### Returns - **Self** (Platform) - The detected platform variant. ``` -------------------------------- ### pub async fn reset_config() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/config/fn.reset_config.html?search=std%3A%3Avec Resets the configuration to defaults and returns the new configuration or an error message. ```APIDOC ## reset_config ### Description Resets the configuration to defaults. ### Signature `pub async fn reset_config() -> Result` ### Returns - **Result** - Returns the reset `CrabCameraConfig` on success, or a `String` containing an error message on failure. ``` -------------------------------- ### list_v4l2_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/index.html Lists all available V4L2 devices found in /dev/video*. ```APIDOC ## list_v4l2_devices ### Description List all V4L2 devices in /dev/video*. ### Signature `pub fn list_v4l2_devices() -> Vec` ``` -------------------------------- ### PlatformCamera::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/enum.PlatformCamera.html?search= Creates a new instance of a platform-specific camera based on the provided initialization parameters. ```APIDOC ## pub fn new(params: CameraInitParams) -> Result ### Description Initializes a new platform camera instance using the provided configuration parameters. ### Parameters - **params** (CameraInitParams) - Required - Configuration parameters for camera initialization. ### Returns - **Result** - Returns the initialized camera instance or an error if initialization fails. ``` -------------------------------- ### crabcamera::init Source: https://docs.rs/crabcamera Initializes the CrabCamera plugin for use within a Tauri application. ```APIDOC ## Function: crabcamera::init ### Description Initializes the CrabCamera plugin with all available commands for the Tauri application. ### Usage ```rust use crabcamera; fn main() { tauri::Builder::default() .plugin(crabcamera::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` ``` -------------------------------- ### create_mock_device Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.create_mock_device.html?search=std%3A%3Avec Helper function to create a mock camera device for testing. ```APIDOC ## Function: create_mock_device ### Description Creates a mock `CameraDeviceInfo` object for use in tests. ### Signature `pub fn create_mock_device(id: &str, name: &str, platform: Platform) -> CameraDeviceInfo` ### Parameters - **id** (&str) - The unique identifier for the mock device. - **name** (&str) - The display name for the mock device. - **platform** (Platform) - The platform associated with the mock device. ### Returns - **CameraDeviceInfo** - The constructed mock device information object. ``` -------------------------------- ### create_mock_device Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.create_mock_device.html Helper function to create a mock camera device for testing purposes. ```APIDOC ## Function: create_mock_device ### Description Helper function to create a mock camera device. ### Signature `pub fn create_mock_device(id: &str, name: &str, platform: Platform) -> CameraDeviceInfo` ### Parameters - **id** (&str) - The unique identifier for the mock device. - **name** (&str) - The display name for the mock device. - **platform** (Platform) - The platform configuration for the mock device. ### Returns - **CameraDeviceInfo** - The initialized mock camera device information object. ``` -------------------------------- ### Initialize CrabCamera in Tauri Source: https://docs.rs/crabcamera Register the CrabCamera plugin within the Tauri application builder. ```rust use crabcamera; fn main() { tauri::Builder::default() .plugin(crabcamera::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` -------------------------------- ### CameraControls::professional() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraControls.html?search=std%3A%3Avec Creates a new instance of CameraControls with professional-grade default settings. ```APIDOC ## pub fn professional() -> Self ### Description Returns a new instance of `CameraControls` initialized with professional photography settings. ### Signature `pub fn professional() -> Self` ``` -------------------------------- ### list_v4l2_devices() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/fn.list_v4l2_devices.html?search=u32+-%3E+bool Lists all V4L2 devices found in the /dev/video* directory. ```APIDOC ## Function: list_v4l2_devices ### Description Retrieves a list of all V4L2 (Video4Linux2) devices currently available on the system by scanning the /dev/video* directory. ### Signature `pub fn list_v4l2_devices() -> Result, CameraError>` ### Returns - **Result, CameraError>>** - A Result containing a vector of strings representing the device paths on success, or a CameraError if the operation fails. ``` -------------------------------- ### initialize_camera_system function signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.initialize_camera_system.html The function signature for initializing the camera system, returning a Result containing a success message or an error string. ```rust pub async fn initialize_camera_system() -> Result ``` -------------------------------- ### list_v4l2_devices() Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/fn.list_v4l2_devices.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Lists all V4L2 devices found in the /dev/video* directory. ```APIDOC ## Function: list_v4l2_devices ### Description Lists all V4L2 (Video4Linux2) devices present on the system by scanning the /dev/video* path. ### Signature `pub fn list_v4l2_devices() -> Result, CameraError>` ### Returns - **Result, CameraError>**: Returns a vector of strings representing the paths of the detected V4L2 devices on success, or a `CameraError` if the operation fails. ``` -------------------------------- ### MockCameraSystem::get_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/struct.MockCameraSystem.html?search= Retrieves a list of all currently registered mock devices. ```APIDOC ## pub async fn get_devices(&self) -> Vec ### Description Get all devices. Panics if the internal mutex is poisoned. ``` -------------------------------- ### MockCameraSystem Methods Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/struct.MockCameraSystem.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods available for interacting with the MockCameraSystem instance. ```APIDOC ## MockCameraSystem Methods ### new Creates a new instance of MockCameraSystem. ### add_mock_devices Adds mock devices to the system for testing. - **platform** (Platform) - The platform configuration to use. ### get_devices Retrieves a list of all currently registered mock devices. - **Returns**: Vec ### set_capture_mode Configures the capture mode for the mock system. - **mode** (MockCaptureMode) - The capture mode to set. ### set_error_mode Sets an error mode to simulate camera failures. - **error** (Option) - The error to simulate, or None to clear. ``` -------------------------------- ### CameraDeviceInfo::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraDeviceInfo.html Creates a new instance of CameraDeviceInfo with the specified ID and name. ```APIDOC ## pub fn new(id: String, name: String) -> Self ### Description Creates a new camera device info instance. ### Parameters - **id** (String) - The unique identifier for the camera. - **name** (String) - The display name of the camera. ``` -------------------------------- ### CameraDeviceInfo::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraDeviceInfo.html?search= Creates a new instance of CameraDeviceInfo with the specified ID and name. ```APIDOC ## pub fn new(id: String, name: String) -> Self ### Description Creates a new camera device info instance. ### Parameters - **id** (String) - Required - The unique identifier for the camera. - **name** (String) - Required - The display name of the camera. ``` -------------------------------- ### MockCameraSystem::add_mock_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/struct.MockCameraSystem.html?search= Adds mock devices to the system based on the provided platform. ```APIDOC ## pub async fn add_mock_devices(&self, platform: Platform) ### Description Adds mock devices for testing. Panics if the internal mutex is poisoned. ``` -------------------------------- ### get_or_create_camera Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.get_or_create_camera.html?search=std%3A%3Avec Retrieves an existing camera or initializes a new one. ```APIDOC ## Function: get_or_create_camera ### Description Retrieves an existing camera instance or creates a new one if it does not exist. ### Signature `pub async fn get_or_create_camera(device_id: String, format: CameraFormat) -> Result>, String>` ### Parameters - **device_id** (String) - The unique identifier for the camera device. - **format** (CameraFormat) - The format configuration for the camera. ### Returns - **Result>, String>** - Returns a thread-safe reference to the PlatformCamera on success, or an error message string on failure. ``` -------------------------------- ### get_or_create_camera Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.get_or_create_camera.html?search= Retrieves an existing camera or initializes a new one. ```APIDOC ## pub async fn get_or_create_camera(device_id: String, format: CameraFormat) -> Result>, String> ### Description Get an existing camera instance or create a new one if it does not exist. ### Parameters - **device_id** (String) - The identifier for the camera device. - **format** (CameraFormat) - The format configuration for the camera. ### Returns - **Result>, String>** - Returns an Arc-wrapped Mutex of the PlatformCamera on success, or an error string on failure. ``` -------------------------------- ### MockCameraSystem::add_mock_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/struct.MockCameraSystem.html?search=std%3A%3Avec Adds mock devices to the system for testing. ```APIDOC ## pub async fn add_mock_devices(&self, platform: Platform) ### Description Registers mock devices based on the provided platform configuration. ### Parameters - **platform** (Platform) - Required - The platform configuration to use for adding mock devices. ### Panics Panics if the internal mutex is poisoned. ``` -------------------------------- ### Retrieve optimal camera settings Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_optimal_settings.html?search= Asynchronous function to fetch CameraInitParams for high-quality capture. ```rust pub async fn get_optimal_settings() -> Result ``` -------------------------------- ### CameraFormat Factory Methods Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraFormat.html Convenience methods to create pre-configured CameraFormat instances. ```APIDOC ## pub fn hd() -> Self Creates a high resolution CameraFormat instance. ## pub fn standard() -> Self Creates a standard resolution CameraFormat instance. ## pub fn low() -> Self Creates a low resolution CameraFormat instance. ``` -------------------------------- ### SmartTrigger::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/quality/smart_trigger/struct.SmartTrigger.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of the SmartTrigger with the provided configuration. ```APIDOC pub fn new(config: TriggerConfig) -> Self ``` -------------------------------- ### Initialize test environment Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.init_test_env.html?search= Initializes the environment required for running tests. ```rust pub fn init_test_env() ``` -------------------------------- ### Create mock device function signature Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/fn.create_mock_device.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Defines the signature for creating a mock camera device. Requires a string ID, string name, and a Platform enum variant. ```rust pub fn create_mock_device( id: &str, name: &str, platform: Platform, ) -> CameraDeviceInfo ``` -------------------------------- ### list_v4l2_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/index.html?search=std%3A%3Avec Enumerates all available V4L2 devices located in /dev/video*. ```APIDOC ## list_v4l2_devices ### Description List all V4L2 devices in /dev/video*. ``` -------------------------------- ### get_recommended_format Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_recommended_format.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the recommended camera format for high-quality photography. ```APIDOC ## Function: get_recommended_format ### Description Retrieves the recommended camera format for high-quality photography. ### Signature `pub async fn get_recommended_format() -> Result` ### Returns - **Result**: Returns a `CameraFormat` on success, or a `String` containing an error message on failure. ``` -------------------------------- ### get_recommended_format Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_recommended_format.html?search=std%3A%3Avec Retrieves the recommended camera format for high-quality photography. ```APIDOC ## Function: get_recommended_format ### Description Retrieves the recommended camera format for high-quality photography. ### Signature `pub async fn get_recommended_format() -> Result` ### Returns - **Result** - Returns a `CameraFormat` on success, or a `String` containing an error message if the operation fails. ``` -------------------------------- ### get_recommended_format Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/init/fn.get_recommended_format.html?search=u32+-%3E+bool Retrieves the recommended camera format for high-quality photography. ```APIDOC ## Function: get_recommended_format ### Description Retrieves the recommended camera format for high-quality photography. ### Signature `pub async fn get_recommended_format() -> Result` ### Returns - **Result**: Returns a `CameraFormat` object on success, or a `String` containing an error message on failure. ``` -------------------------------- ### list_v4l2_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/linux/utils/index.html?search= Enumerates all available V4L2 devices located in /dev/video*. ```APIDOC ## list_v4l2_devices ### Description List all V4L2 devices in /dev/video*. ### Signature `pub fn list_v4l2_devices() -> ...` ``` -------------------------------- ### MockCameraSystem::get_devices Source: https://docs.rs/crabcamera/0.8.3/crabcamera/tests/struct.MockCameraSystem.html?search=std%3A%3Avec Retrieves the list of currently registered mock devices. ```APIDOC ## pub async fn get_devices(&self) -> Vec ### Description Returns a list of all mock devices currently managed by the system. ### Returns - **Vec** - A list of camera device information objects. ### Panics Panics if the internal mutex is poisoned. ``` -------------------------------- ### CameraControls::professional Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraControls.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of CameraControls with professional-grade default settings. ```APIDOC ## pub fn professional() -> Self ### Description Creates a new instance of the CameraControls struct initialized with professional photography settings. ### Signature `pub fn professional() -> Self` ``` -------------------------------- ### get_or_create_camera Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/capture/fn.get_or_create_camera.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves an existing camera or initializes a new one using the specified device identifier and format. ```APIDOC ## Function: get_or_create_camera ### Description Retrieves an existing camera instance or creates a new one if it does not exist. This function is asynchronous and returns a thread-safe reference to the platform camera. ### Signature `pub async fn get_or_create_camera(device_id: String, format: CameraFormat) -> Result>, String>` ### Parameters - **device_id** (String) - The unique identifier for the camera device. - **format** (CameraFormat) - The configuration format for the camera. ### Returns - **Result>, String>** - Returns a thread-safe reference to the camera on success, or an error message string on failure. ``` -------------------------------- ### SmartTrigger::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/quality/smart_trigger/struct.SmartTrigger.html?search= Creates a new instance of SmartTrigger with the provided configuration. ```APIDOC ## pub fn new(config: TriggerConfig) -> Self ### Description Initializes a new SmartTrigger instance using the specified TriggerConfig. ### Parameters - **config** (TriggerConfig) - Required - The configuration settings for the trigger. ``` -------------------------------- ### MockCamera::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/struct.MockCamera.html?search= Creates a new instance of MockCamera with a specified device ID and format. ```APIDOC ## pub fn new(device_id: String, format: CameraFormat) -> Self ### Description Initializes a new MockCamera instance. ### Parameters - **device_id** (String) - Required - The unique identifier for the camera device. - **format** (CameraFormat) - Required - The initial camera format configuration. ``` -------------------------------- ### pub async fn reset_config() -> Result Source: https://docs.rs/crabcamera/0.8.3/crabcamera/commands/config/fn.reset_config.html?search= Resets the current configuration to default values. Returns a Result containing the new CrabCameraConfig on success or an error string on failure. ```APIDOC ## reset_config ### Description Resets the camera configuration to defaults. ### Signature `pub async fn reset_config() -> Result` ### Returns - **Result** - Returns the reset `CrabCameraConfig` object on success, or an error message as a `String` on failure. ``` -------------------------------- ### CameraFormat::standard Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraFormat.html?search= Creates a pre-configured standard-definition CameraFormat instance. ```APIDOC ## pub fn standard() -> Self ### Description Returns a new CameraFormat instance configured for standard resolution. ``` -------------------------------- ### CameraDeviceInfo Configuration Methods Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraDeviceInfo.html Methods to configure optional fields for a CameraDeviceInfo instance. ```APIDOC ## Configuration Methods ### with_description(self, description: String) -> Self Sets the description for the camera device. ### with_formats(self, formats: Vec) -> Self Sets the supported formats for the camera device. ### with_availability(self, available: bool) -> Self Sets the availability status of the camera device. ``` -------------------------------- ### MockCamera::new Source: https://docs.rs/crabcamera/0.8.3/crabcamera/platform/struct.MockCamera.html?search=u32+-%3E+bool Creates a new instance of MockCamera with the specified device ID and format. ```APIDOC ## pub fn new(device_id: String, format: CameraFormat) -> Self ### Description Initializes a new MockCamera instance. ### Parameters - **device_id** (String) - The unique identifier for the camera device. - **format** (CameraFormat) - The initial camera format configuration. ``` -------------------------------- ### Platform::current Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/enum.Platform.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Detects and returns the current operating system platform. ```APIDOC ## Platform::current() ### Description Detects the current platform the application is running on. ### Signature `pub fn current() -> Self` ### Returns - **Platform** - The current platform variant (Windows, MacOS, Linux, or Unknown). ``` -------------------------------- ### CameraControls::professional Source: https://docs.rs/crabcamera/0.8.3/crabcamera/types/struct.CameraControls.html Creates a new instance of CameraControls configured with professional photography defaults. ```APIDOC ## fn professional() ### Description Returns a new instance of `CameraControls` initialized with professional photography settings. ### Signature `pub fn professional() -> Self` ```