Struct cameleon::genapi::ParamsCtxt [−][src]
pub struct ParamsCtxt<Ctrl, Ctxt> { pub ctrl: Ctrl, pub ctxt: Ctxt, }
Expand description
Manages context of parameters of the device.
Examples
// Loads `GenApi` context. camera.load_context().unwrap(); let mut params_ctxt = camera.params_ctxt().unwrap(); // Get `Gain` node of `GenApi`. // `GenApi SFNC` defines that `Gain` node should have `IFloat` interface, // so this conversion would be success if the camera follows that. // Some vendors may define `Gain` node as `IInteger`, in that case, use // `as_integer(¶ms_ctxt)` instead of `as_float(¶ms_ctxt). let gain_node = params_ctxt.node("Gain").unwrap().as_float(¶ms_ctxt).unwrap(); // Get the current value of `Gain`. if gain_node.is_readable(&mut params_ctxt).unwrap() { let value = gain_node.value(&mut params_ctxt).unwrap(); println!("{}", value); } // Set `0.1` to `Gain`. if gain_node.is_writable(&mut params_ctxt).unwrap() { gain_node.set_value(&mut params_ctxt, 0.1).unwrap(); }
Fields
ctrl: Ctrl
Control handle of the device.
ctxt: Ctxt
GenApi
context of the device.
Implementations
pub fn convert_from<Ctrl2, Ctxt2>(from: ParamsCtxt<Ctrl2, Ctxt2>) -> Self where
Ctrl: From<Ctrl2>,
Ctxt: From<Ctxt2>,
[src]
pub fn convert_from<Ctrl2, Ctxt2>(from: ParamsCtxt<Ctrl2, Ctxt2>) -> Self where
Ctrl: From<Ctrl2>,
Ctxt: From<Ctxt2>,
[src]Converts internal types. This method work same as std::convert::From
, just hack to avoid
E0119
.
pub fn convert_into<Ctrl2, Ctxt2>(self) -> ParamsCtxt<Ctrl2, Ctxt2> where
Ctrl: Into<Ctrl2>,
Ctxt: Into<Ctxt2>,
[src]
pub fn convert_into<Ctrl2, Ctxt2>(self) -> ParamsCtxt<Ctrl2, Ctxt2> where
Ctrl: Into<Ctrl2>,
Ctxt: Into<Ctxt2>,
[src]Converts internal types. This method work same as std::convert::Into
, just hack to avoid
E0119
.
Trait Implementations
Auto Trait Implementations
impl<Ctrl, Ctxt> RefUnwindSafe for ParamsCtxt<Ctrl, Ctxt> where
Ctrl: RefUnwindSafe,
Ctxt: RefUnwindSafe,
impl<Ctrl, Ctxt> Send for ParamsCtxt<Ctrl, Ctxt> where
Ctrl: Send,
Ctxt: Send,
impl<Ctrl, Ctxt> Sync for ParamsCtxt<Ctrl, Ctxt> where
Ctrl: Sync,
Ctxt: Sync,
impl<Ctrl, Ctxt> Unpin for ParamsCtxt<Ctrl, Ctxt> where
Ctrl: Unpin,
Ctxt: Unpin,
impl<Ctrl, Ctxt> UnwindSafe for ParamsCtxt<Ctrl, Ctxt> where
Ctrl: UnwindSafe,
Ctxt: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self