pub enum ModificationResponse<T> {
Entity(T),
Task(AsyncTask),
Empty,
}Expand description
Outcome of a mutating Redfish operation.
Variants§
Entity(T)
Request completed synchronously.
Task(AsyncTask)
Request is completing asynchronously with the provided task location.
Empty
Request completed successfully with no response body.
Implementations§
Source§impl<T> ModificationResponse<T>
impl<T> ModificationResponse<T>
Sourcepub fn map_entity<U, F>(self, f: F) -> ModificationResponse<U>where
F: FnOnce(T) -> U,
pub fn map_entity<U, F>(self, f: F) -> ModificationResponse<U>where
F: FnOnce(T) -> U,
Maps an entity outcome while preserving task and empty outcomes.
Sourcepub fn try_map_entity<U, E, F>(self, f: F) -> Result<ModificationResponse<U>, E>
pub fn try_map_entity<U, E, F>(self, f: F) -> Result<ModificationResponse<U>, E>
Maps an entity outcome with a fallible function while preserving task and empty outcomes.
§Errors
Returns the error produced by f when this response contains an entity.
Sourcepub async fn try_map_entity_async<U, E, F, Fut>(
self,
f: F,
) -> Result<ModificationResponse<U>, E>
pub async fn try_map_entity_async<U, E, F, Fut>( self, f: F, ) -> Result<ModificationResponse<U>, E>
Asynchronously maps an entity outcome with a fallible function while preserving task and empty outcomes.
§Errors
Returns the error produced by f when this response contains an entity.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ModificationResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for ModificationResponse<T>where
T: RefUnwindSafe,
impl<T> Send for ModificationResponse<T>where
T: Send,
impl<T> Sync for ModificationResponse<T>where
T: Sync,
impl<T> Unpin for ModificationResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for ModificationResponse<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ModificationResponse<T>where
T: UnwindSafe,
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