pub struct Control<B: Bmc> { /* private fields */ }Expand description
Control entity wrapper.
The raw schema data contains the target BMC’s reported control properties, including set point, units, allowable range, and related metadata when the service provides them.
Implementations§
Source§impl<B: Bmc> Control<B>
impl<B: Bmc> Control<B>
Sourcepub fn raw(&self) -> Arc<ControlSchema> ⓘ
pub fn raw(&self) -> Arc<ControlSchema> ⓘ
Get the raw control schema data.
Sourcepub async fn update(
&self,
update: &ControlUpdate,
) -> Result<ModificationResponse<Self>, Error<B>>
pub async fn update( &self, update: &ControlUpdate, ) -> Result<ModificationResponse<Self>, Error<B>>
Update this control.
§Example
ⓘ
use nv_redfish::control::ControlUpdate;
use nv_redfish::core::ModificationResponse;
let update = ControlUpdate::builder().with_set_point(700.0).build();
match power_limit.update(&update).await? {
ModificationResponse::Entity(updated) => {
let _updated_control = updated.raw();
}
ModificationResponse::Task(task) => {
let _update_task = task;
}
ModificationResponse::Empty => {}
}§Errors
Returns an error if updating the control fails.
Trait Implementations§
Source§impl<B: Bmc> Resource for Control<B>
impl<B: Bmc> Resource for Control<B>
Source§fn resource_ref(&self) -> &ResourceSchema
fn resource_ref(&self) -> &ResourceSchema
Required function. Must be implemented for Redfish resources.
Source§fn id(&self) -> ResourceIdRef<'_>
fn id(&self) -> ResourceIdRef<'_>
Identifier of the resource.
Source§fn name(&self) -> ResourceNameRef<'_>
fn name(&self) -> ResourceNameRef<'_>
Name of the resource.
Source§fn description(&self) -> Option<ResourceDescriptionRef<'_>>
fn description(&self) -> Option<ResourceDescriptionRef<'_>>
Description of the resource.
Auto Trait Implementations§
impl<B> Freeze for Control<B>
impl<B> RefUnwindSafe for Control<B>where
B: RefUnwindSafe,
impl<B> Send for Control<B>
impl<B> Sync for Control<B>
impl<B> Unpin for Control<B>
impl<B> UnsafeUnpin for Control<B>
impl<B> UnwindSafe for Control<B>where
B: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more