pub struct Device { /* private fields */ }
Expand description
A type representing a RealSense device.
A device in librealsense2 corresponds to a physical unit that connects to your computer (usually via USB). Devices hold a list of sensors, which in turn are represented by a list of streams producing frames.
Devices are usually acquired by the driver context.
Implementations§
Source§impl Device
impl Device
Sourcepub fn sensors(&self) -> Vec<Sensor>
pub fn sensors(&self) -> Vec<Sensor>
Gets a list of sensors associated with the device.
Returns a vector of zero size if any error occurs while trying to read the sensor list. This can occur if the physical device is disconnected before this call is made.
Sourcepub fn hardware_reset(self)
pub fn hardware_reset(self)
Takes ownership of the device and forces a hardware reset on the device.
Ownership of the device is taken as the underlying state can no longer be safely retained after resetting the device.
Sourcepub fn info(&self, camera_info: Rs2CameraInfo) -> Option<&CStr>
pub fn info(&self, camera_info: Rs2CameraInfo) -> Option<&CStr>
Gets the value associated with the provided camera info key from the device.
Returns some information value associated with the camera info key if the camera_info
is
supported by the device, else it returns None
.
Sourcepub fn supports_info(&self, camera_info: Rs2CameraInfo) -> bool
pub fn supports_info(&self, camera_info: Rs2CameraInfo) -> bool
Predicate for checking if camera_info
is supported for this device.
Returns true iff the device has a value associated with the camera_info
key.
Trait Implementations§
Source§impl From<NonNull<rs2_device>> for Device
impl From<NonNull<rs2_device>> for Device
Source§fn from(device_ptr: NonNull<rs2_device>) -> Self
fn from(device_ptr: NonNull<rs2_device>) -> Self
Attempt to construct a Device from a non-null pointer to rs2_device
.
Constructs a device from a pointer to an rs2_device
type from the C-FFI.