#[non_exhaustive]pub enum RawEvent {
RenderAdded(RawRenderAdded),
RenderDone(RawRenderDone),
RenderFailed(RawRenderFailed),
RenderProgress(RawRenderProgress),
CustomSkinProcessUpdate(RawCustomSkinProcessUpdate),
}Expand description
Websocket Event that has not been fully deserialized yet.
This lets you check if you’re interested in the event and only then deserialize it.
§Example
use std::collections::HashSet;
use rosu_render::websocket::event::RawEvent;
fn handle_event(event: RawEvent, interesting_render_ids: &HashSet<u32>) {
match event {
RawEvent::RenderDone(event) if interesting_render_ids.contains(&event.render_id) => {
match event.deserialize() {
Ok(done) => println!("{done:?}"),
Err(err) => println!("Failed to deserialize {event:?} {err:?}"),
}
}
_ => {} // Ignore
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
RenderAdded(RawRenderAdded)
RenderDone(RawRenderDone)
RenderFailed(RawRenderFailed)
RenderProgress(RawRenderProgress)
CustomSkinProcessUpdate(RawCustomSkinProcessUpdate)
Implementations§
Source§impl RawEvent
impl RawEvent
Sourcepub fn deserialize(&self) -> Result<Event, SerdeError>
pub fn deserialize(&self) -> Result<Event, SerdeError>
Deserialize into an Event.
Trait Implementations§
impl Eq for RawEvent
impl StructuralPartialEq for RawEvent
Auto Trait Implementations§
impl !Freeze for RawEvent
impl RefUnwindSafe for RawEvent
impl Send for RawEvent
impl Sync for RawEvent
impl Unpin for RawEvent
impl UnwindSafe for RawEvent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.