pub struct InputHelper { /* private fields */ }
Expand description

Input helper The main struct of the API.

Create with WinitInputHelper::new. Call WinitInputHelper::update for every winit::event::Event you receive from winit. WinitInputHelper::update returning true indicates a step has occured. You should now run your application logic, calling any of the accessor methods you need.

An alternative API is provided via WinitInputHelper::step_with_window_events, call this method instead of WinitInputHelper::update if you need to manually control when a new step begins. A step occurs every time this method is called.

Do not mix usages of WinitInputHelper::update and WinitInputHelper::step_with_window_events. You should stick to one or the other.

Implementations§

source§

impl WinitInputHelper

source

pub fn new() -> WinitInputHelper

source

pub fn update<T>(&mut self, event: &Event<T>) -> bool

Pass every winit event to this function and run your application logic when it returns true.

The following winit events are handled:

  • Event::NewEvents clears all internal state.
  • Event::MainEventsCleared causes this function to return true, signifying a “step” has completed.
  • Event::WindowEvent updates internal state, this will affect the result of accessor methods immediately.
  • Event::DeviceEvent updates value of mouse_diff()
source

pub fn step_with_window_events(&mut self, events: &[WindowEvent])

Pass a slice containing every winit event that occured within the step to this function. Ensure this method is only called once per application main loop. Ensure every event since the last WinitInputHelper::step_with_window_events call is included in the events argument.

WinitInputHelper::Update is easier to use. But this method is useful when your application logic steps dont line up with winit’s event loop. e.g. you have a seperate thread for application logic using WinitInputHelper that constantly runs regardless of winit’s event loop and you need to send events to it directly.

source

pub fn key_pressed(&self, keycode: KeyCode) -> bool

Returns true when the key with the specified keycode goes from “not pressed” to “pressed”. Otherwise returns false.

Uses physical keys in the US layout, so for example the W key will be in the same physical key on both US and french keyboards.

This is suitable for game controls.

source

pub fn key_pressed_os(&self, keycode: KeyCode) -> bool

Returns true when the key with the specified keycode goes from “not pressed” to “pressed”. Otherwise returns false.

Uses physical keys in the US layout, so for example the W key will be in the same physical key on both US and french keyboards.

Will repeat key presses while held down according to the OS’s key repeat configuration This is suitable for UI.

source

pub fn key_released(&self, keycode: KeyCode) -> bool

Returns true when the key with the specified KeyCode goes from “pressed” to “not pressed”. Otherwise returns false.

Uses physical keys in the US layout, so for example the W key will be in the same physical key on both US and french keyboards.

source

pub fn key_held(&self, keycode: KeyCode) -> bool

Returns true when the key with the specified keycode remains “pressed”. Otherwise returns false.

Uses physical keys in the US layout, so for example the W key will be in the same physical key on both US and french keyboards.

Examples found in repository?
examples/dev/dev.rs (line 104)
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
fn main() {
    let mut engine = Engine::new().expect("win");

    //let test_instance = Instance::default();
    //println!("{:?}", test_instance.to_raw());

    let texture = engine
        .renderer
        .build_texture(
            "background",
            TextureData::Path("resources/BlueLogoDiscord.png".to_string()),
            blue_engine::TextureMode::Clamp,
        )
        .unwrap();
    let texture2 = engine
        .renderer
        .build_texture(
            "background",
            TextureData::Path("resources/player.png".to_string()),
            blue_engine::TextureMode::Clamp,
        )
        .unwrap();

    let texture3 = engine
        .renderer
        .build_texture(
            "background",
            TextureData::Path("resources/image.png".to_string()),
            blue_engine::TextureMode::Clamp,
        )
        .unwrap();

    square(
        "main",
        ObjectSettings::default(),
        &mut engine.renderer,
        &mut engine.objects,
    );

    engine.objects.get_mut("main").unwrap().set_texture(texture);
    engine
        .objects
        .get_mut("main")
        .unwrap()
        .set_position(-1f32, 0f32, 0f32);

    square(
        "alt",
        ObjectSettings::default(),
        &mut engine.renderer,
        &mut engine.objects,
    );
    engine.objects.get_mut("alt").unwrap().set_texture(texture2);
    engine
        .objects
        .get_mut("alt")
        .unwrap()
        .set_position(0.2f32, 0f32, 0.001f32);

    square(
        "alt2",
        ObjectSettings::default(),
        &mut engine.renderer,
        &mut engine.objects,
    );
    engine
        .objects
        .get_mut("alt2")
        .unwrap()
        .set_texture(texture3);
    engine
        .objects
        .get_mut("alt2")
        .unwrap()
        .set_position(-0.2f32, 0f32, 0.001f32);

    let speed = -0.05;

    let mut last_time = std::time::Instant::now();
    let mut frames = 0;
    engine
        .update_loop(move |renderer, _window, objects, input, camera, plugins| {
            // calculate FPS
            let current_time = std::time::Instant::now();
            frames += 1;
            if current_time - last_time >= std::time::Duration::from_secs(1) {
                println!("{}ms/frame", 1000f32 / frames as f32);
                frames = 0;
                last_time = current_time;
            }

            let sprite = objects.get_mut("alt").unwrap();

            if input.key_held(blue_engine::KeyCode::ArrowUp) {
                sprite.set_position(
                    sprite.position.x,
                    sprite.position.y - speed,
                    sprite.position.z,
                );
                //lm.ambient_color.data = [1f32, 1f32, 1f32, 1f32];
            }
            if input.key_held(blue_engine::KeyCode::ArrowDown) {
                sprite.set_position(
                    sprite.position.x,
                    sprite.position.y + speed,
                    sprite.position.z,
                );
                //lm.ambient_color.data = [0.1f32, 0.1f32, 0.1f32, 1f32];
            }

            if input.key_held(blue_engine::KeyCode::ArrowLeft) {
                sprite.set_position(
                    sprite.position.x + speed,
                    sprite.position.y,
                    sprite.position.z,
                );
            }
            if input.key_held(blue_engine::KeyCode::ArrowRight) {
                sprite.set_position(
                    sprite.position.x - speed,
                    sprite.position.y,
                    sprite.position.z,
                );
            }

            if input.key_held(blue_engine::KeyCode::KeyE) {
                sprite.set_position(
                    sprite.position.x,
                    sprite.position.y,
                    sprite.position.z + speed,
                );
            }
            if input.key_held(blue_engine::KeyCode::KeyQ) {
                sprite.set_position(
                    sprite.position.x,
                    sprite.position.y,
                    sprite.position.z - speed,
                );
            }
        })
        .expect("Error during update loop");
}
source

pub fn held_shift(&self) -> bool

Returns true while any shift key is held on the keyboard. Otherwise returns false.

Uses physical keys.

source

pub fn held_control(&self) -> bool

Returns true while any control key is held on the keyboard. Otherwise returns false.

Uses physical keys.

source

pub fn held_alt(&self) -> bool

Returns true while any alt key is held on the keyboard. Otherwise returns false.

Uses physical keys.

source

pub fn key_pressed_logical(&self, check_key: Key<&str>) -> bool

Returns true when the specified keyboard key goes from “not pressed” to “pressed”. Otherwise returns false.

Uses logical keypresses, so for example W is changed between a US and french keyboard. Will never repeat keypresses while held.

source

pub fn key_pressed_os_logical(&self, check_key: Key<&str>) -> bool

Returns true when the specified keyboard key goes from “not pressed” to “pressed”. Otherwise returns false.

Uses logical keypresses, so for example W is changed between a US and french keyboard.

Will repeat key presses while held down according to the OS’s key repeat configuration This is suitable for UI.

source

pub fn key_released_logical(&self, check_key: Key<&str>) -> bool

Returns true when the specified keyboard key goes from “pressed” to “not pressed”. Otherwise returns false.

Uses logical keypresses, so for example W is changed between a US and french keyboard.

source

pub fn key_held_logical(&self, check_key: Key<&str>) -> bool

Returns true while the specified keyboard key remains “pressed”. Otherwise returns false.

Uses logical keypresses, so for example W is changed between a US and french keyboard.

source

pub fn mouse_pressed(&self, check_mouse_button: usize) -> bool

Returns true when the specified mouse button goes from “not pressed” to “pressed”. Otherwise returns false.

Left => 0 Right => 1 Middle => 2 Other => 3..255

source

pub fn mouse_released(&self, check_mouse_button: usize) -> bool

Returns true when the specified mouse button goes from “pressed” to “not pressed”. Otherwise returns false.

Left => 0 Right => 1 Middle => 2 Other => 3..255

source

pub fn mouse_held(&self, mouse_button: usize) -> bool

Returns true while the specified mouse button remains “pressed”. Otherwise returns false.

Left => 0 Right => 1 Middle => 2 Other => 3..255

source

pub fn scroll_diff(&self) -> (f32, f32)

Returns (0.0, 0.0) when the window is not focused. Otherwise returns the amount scrolled by the mouse during the last step. Returns (horizontally, vertically)

source

pub fn cursor(&self) -> Option<(f32, f32)>

Returns the cursor coordinates in pixels, when window is focused AND (cursor is on window OR any mouse button remains held while cursor moved off window) Otherwise returns None

source

pub fn cursor_diff(&self) -> (f32, f32)

Returns the change in cursor coordinates that occured during the last step, when window is focused AND (cursor is on window OR any mouse button remains held while cursor moved off window) Otherwise returns (0.0, 0.0).

source

pub fn mouse_diff(&self) -> (f32, f32)

Returns the change in mouse coordinates that occured during the last step.

This is useful when implementing first person controls with a captured mouse.

Because this uses DeviceEvents, the step_with_windows_events function won’t update this as it is not a WindowEvent.

source

pub fn text(&self) -> Vec<TextChar>

Returns the characters pressed during the last step. The earlier the character was pressed, the lower the index in the Vec.

source

pub fn dropped_file(&self) -> Option<PathBuf>

Returns the path to a file that has been drag-and-dropped onto the window.

source

pub fn window_resized(&self) -> Option<PhysicalSize<u32>>

Returns the current window size if it was resized during the last step. Otherwise returns None.

source

pub fn resolution(&self) -> Option<(u32, u32)>

Returns None when no WindowEvent::Resized have been received yet. After one has been received it returns the current resolution of the window.

source

pub fn scale_factor_changed(&self) -> Option<f64>

Returns the current scale factor if it was changed during the last step. Otherwise returns None.

source

pub fn scale_factor(&self) -> Option<f64>

Returns None when no WindowEvent::ScaleFactorChanged have been received yet. After one has been received it returns the current scale_factor of the window.

source

pub fn destroyed(&self) -> bool

Returns true if the window has been destroyed Otherwise returns false. Once this method has returned true once all following calls to this method will also return true.

source

pub fn close_requested(&self) -> bool

Returns true if the OS has requested the application to close during this step. Otherwise returns false.

source

pub fn quit(&self) -> bool

👎Deprecated: Instead use input.close_requested() || input.destroyed()

Deprecated

source

pub fn delta_time(&self) -> Option<Duration>

Returns the std::time::Duration elapsed since the last step. Returns None if the step is still in progress.

Trait Implementations§

source§

impl Clone for WinitInputHelper

source§

fn clone(&self) -> WinitInputHelper

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for WinitInputHelper

source§

fn default() -> WinitInputHelper

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Any for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

source§

fn type_name(&self) -> &'static str

source§

impl<T> AnySync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,