Struct spin_core::HostComponentsData
source · pub struct HostComponentsData { /* private fields */ }
Expand description
Holds a heterogenous set of HostComponent::Data
s.
Implementations§
source§impl HostComponentsData
impl HostComponentsData
sourcepub fn set<HC: HostComponent>(
&mut self,
handle: HostComponentDataHandle<HC>,
data: HC::Data
)
pub fn set<HC: HostComponent>( &mut self, handle: HostComponentDataHandle<HC>, data: HC::Data )
Sets the HostComponent::Data
for the given handle
.
sourcepub fn get_or_insert<HC: HostComponent>(
&mut self,
handle: HostComponentDataHandle<HC>
) -> &mut HC::Data
pub fn get_or_insert<HC: HostComponent>( &mut self, handle: HostComponentDataHandle<HC> ) -> &mut HC::Data
Retrieves a mutable reference to HostComponent::Data
for the given handle
.
If unset, the data will be initialized with HostComponent::build_data
.
§Panics
If the given handle was not obtained from the same [HostComponentsBuilder
] that
was the source of this HostComponentsData
, this function may panic.
sourcepub fn get_or_insert_any(
&mut self,
handle: AnyHostComponentDataHandle
) -> &mut Box<dyn Any + Send>
pub fn get_or_insert_any( &mut self, handle: AnyHostComponentDataHandle ) -> &mut Box<dyn Any + Send>
Retrieves a mutable reference to HostComponent::Data
for the given handle
.
If unset, the data will be initialized with HostComponent::build_data
.
§Panics
If the given handle was not obtained from the same [HostComponentsBuilder
] that
was the source of this HostComponentsData
, this function may panic.
Auto Trait Implementations§
impl !RefUnwindSafe for HostComponentsData
impl Send for HostComponentsData
impl !Sync for HostComponentsData
impl Unpin for HostComponentsData
impl !UnwindSafe for HostComponentsData
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
source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self
file descriptor. Read more