pub struct AnyEvent { /* private fields */ }
Expand description
A dynamic runtime event.
This is a wrapper of Box<dyn Any + Send>
, but saves the underlying type name for better
Debug
impl.
See LspService::emit
for usages of this type.
Implementations§
Source§impl AnyEvent
impl AnyEvent
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
Get the underlying type name for debugging purpose.
The result string is only meant for debugging. It is not stable and cannot be trusted.
Sourcepub fn downcast_ref<T: Send + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Send + 'static>(&self) -> Option<&T>
Returns some reference to the inner value if it is of type T
, or None
if it isn’t.
Sourcepub fn downcast_mut<T: Send + 'static>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Send + 'static>(&mut self) -> Option<&mut T>
Returns some mutable reference to the inner value if it is of type T
, or None
if it
isn’t.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnyEvent
impl !RefUnwindSafe for AnyEvent
impl Send for AnyEvent
impl !Sync for AnyEvent
impl Unpin for AnyEvent
impl !UnwindSafe for AnyEvent
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