pub struct CameraApi<P: CheckedPermissions>(/* private fields */);Implementations§
Source§impl<P: CheckedPermissions> CameraApi<P>
impl<P: CheckedPermissions> CameraApi<P>
pub fn try_new_with_timeout(timeout: Duration) -> Option<Self>
Sourcepub fn subscribe<S>(
&self,
context: &mut ServerContext<S>,
) -> Result<(), SubscriptionError>
pub fn subscribe<S>( &self, context: &mut ServerContext<S>, ) -> Result<(), SubscriptionError>
Start requesting camera frames. Cheap because the frames are not actually sent, but mirrored on the client side. The event is sent when a new frame is available.
Sourcepub fn set_enabled(&self, enabled: bool)where
P: MessageAllowed<SetEnabled>,
pub fn set_enabled(&self, enabled: bool)where
P: MessageAllowed<SetEnabled>,
Enable the use of the camera. Intended to be used by the control center
Sourcepub fn notify_visible(&self, visible: bool)where
P: MessageAllowed<NotifyVisible>,
pub fn notify_visible(&self, visible: bool)where
P: MessageAllowed<NotifyVisible>,
Notify the app that the camera image is visible on the screen. Intended to be used by the GUI server
pub fn is_enabled(&self) -> boolwhere
P: MessageAllowed<IsEnabled>,
pub fn is_in_use(&self) -> boolwhere
P: MessageAllowed<IsInUse>,
Sourcepub fn get_params(&self) -> Result<CameraParams, Error>where
P: MessageAllowed<GetParams>,
pub fn get_params(&self) -> Result<CameraParams, Error>where
P: MessageAllowed<GetParams>,
Get current camera parameters
Sourcepub fn set_params(&self, params: CameraParams) -> Result<(), Error>where
P: MessageAllowed<SetParams>,
pub fn set_params(&self, params: CameraParams) -> Result<(), Error>where
P: MessageAllowed<SetParams>,
Set camera parameters
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for CameraApi<P>
impl<P> RefUnwindSafe for CameraApi<P>
impl<P> Send for CameraApi<P>
impl<P> Sync for CameraApi<P>
impl<P> Unpin for CameraApi<P>
impl<P> UnwindSafe for CameraApi<P>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.