pub struct Shared<T>(/* private fields */);Expand description
A resolved item, shared by every $ref that named it.
Dereferences to the item. It cannot be cloned, and the document it belongs
to hands out borrows only, so a Shared value can never outlive its
document: that is what lets a NestedSchema be dereferenced without a
check, however the schemas refer to each other.
ⓘ
use openapiv3_resolve::{ResolvedSchema, Shared};
fn detach(shared: &Shared<ResolvedSchema>) -> Shared<ResolvedSchema> {
Clone::clone(shared)
}Implementations§
Sourcepub fn as_ptr(this: &Self) -> *const T
pub fn as_ptr(this: &Self) -> *const T
The address of the item, for telling whether two Shared values name
the same component: std::ptr::eq(Shared::as_ptr(a), Shared::as_ptr(b)).
An associated function, like Arc::as_ptr, so it cannot shadow a
method of T.
Trait Implementations§
Auto Trait Implementations§
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