Trait openapi_utils::ReferenceOrExt
source · pub trait ReferenceOrExt<T> {
// Required method
fn to_item_mut(&mut self) -> &mut T;
}
Expand description
This extension deals with ReferenceOr
enums in the spec
All these methods assume the spec has been previously dereferenced,
see the deref_all
method in the spec object.
These methods are still needed because structs hold ReferenceOr
enums, although
these enums always have an item, never a reference.
Required Methods§
sourcefn to_item_mut(&mut self) -> &mut T
fn to_item_mut(&mut self) -> &mut T
Returns mutable reference to internal Item for a ReferenceOr
Implementations on Foreign Types§
source§impl<T> ReferenceOrExt<T> for ReferenceOr<T>
impl<T> ReferenceOrExt<T> for ReferenceOr<T>
source§fn to_item_mut(&mut self) -> &mut T
fn to_item_mut(&mut self) -> &mut T
§Examples
let mut item = ReferenceOr::Item(3);
assert_eq!(to_item_mut(&mut item), &3);