pub struct IOwned<R: Render> { /* private fields */ }
Expand description
Generic smart pointer which owns an inspect subtree (either a Node or a Property) for the duration of its lifetime. It dereferences to the user-provided base type (similar to Arc and other smart pointers). This type should rarely be used declared explictly. Rather, a specific smart pointer (such as IValue) should be used.
Implementations§
Source§impl<R: Render> IOwned<R>
impl<R: Render> IOwned<R>
Sourcepub fn new(value: R::Base) -> Self
pub fn new(value: R::Base) -> Self
Construct the smart pointer but don’t populate any inspect state.
Sourcepub fn attached(value: R::Base, parent: &Node, name: impl AsRef<str>) -> Self
pub fn attached(value: R::Base, parent: &Node, name: impl AsRef<str>) -> Self
Construct the smart pointer and populate the inspect state under parent[name].
Sourcepub fn as_mut(&mut self) -> IOwnedMutGuard<'_, R>
pub fn as_mut(&mut self) -> IOwnedMutGuard<'_, R>
Returns a RAII guard which can be used for mutations. When the guard goes out of scope, the new inspect state is published.
pub fn into_inner(self) -> R::Base
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for IOwned<R>
impl<R> RefUnwindSafe for IOwned<R>
impl<R> Send for IOwned<R>
impl<R> Sync for IOwned<R>
impl<R> Unpin for IOwned<R>
impl<R> UnwindSafe for IOwned<R>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithInspect for T
impl<T> WithInspect for T
Source§fn with_inspect(
self,
parent: &Node,
name: impl AsRef<str>,
) -> Result<T, AttachError>
fn with_inspect( self, parent: &Node, name: impl AsRef<str>, ) -> Result<T, AttachError>
Attaches self to the inspect tree. It is recommended to invoke this as
part of construction. For example: Read more