pub struct WinitSettings {
pub focused_mode: UpdateMode,
pub unfocused_mode: UpdateMode,
}Expand description
Settings for the WinitPlugin.
Fields§
§focused_mode: UpdateModeDetermines how frequently the application can update when it has focus.
unfocused_mode: UpdateModeDetermines how frequently the application can update when it’s out of focus.
Implementations§
Source§impl WinitSettings
impl WinitSettings
Sourcepub fn game() -> WinitSettings
pub fn game() -> WinitSettings
Default settings for games.
Continuous if windows have focus,
reactive_low_power otherwise.
Examples found in repository?
13fn main() {
14 App::new()
15 // Continuous rendering for games - bevy's default.
16 .insert_resource(WinitSettings::game())
17 // Power-saving reactive rendering for applications.
18 .insert_resource(WinitSettings::desktop_app())
19 // You can also customize update behavior with the fields of [`WinitSettings`]
20 .insert_resource(WinitSettings {
21 focused_mode: bevy::winit::UpdateMode::Continuous,
22 unfocused_mode: bevy::winit::UpdateMode::reactive_low_power(Duration::from_millis(10)),
23 })
24 .insert_resource(ExampleMode::Game)
25 .add_plugins(DefaultPlugins.set(WindowPlugin {
26 primary_window: Some(Window {
27 // Turn off vsync to maximize CPU/GPU usage
28 present_mode: PresentMode::AutoNoVsync,
29 ..default()
30 }),
31 ..default()
32 }))
33 .add_systems(Startup, test_setup::setup)
34 .add_systems(
35 Update,
36 (
37 test_setup::cycle_modes,
38 test_setup::rotate_cube,
39 test_setup::update_text,
40 update_winit,
41 ),
42 )
43 .run();
44}
45
46#[derive(Resource, Debug)]
47enum ExampleMode {
48 Game,
49 Application,
50 ApplicationWithRequestRedraw,
51 ApplicationWithWakeUp,
52}
53
54/// Update winit based on the current `ExampleMode`
55fn update_winit(
56 mode: Res<ExampleMode>,
57 mut winit_config: ResMut<WinitSettings>,
58 event_loop_proxy: Res<EventLoopProxyWrapper<WakeUp>>,
59 mut redraw_request_writer: MessageWriter<RequestRedraw>,
60) {
61 use ExampleMode::*;
62 *winit_config = match *mode {
63 Game => {
64 // In the default `WinitSettings::game()` mode:
65 // * When focused: the event loop runs as fast as possible
66 // * When not focused: the app will update when the window is directly interacted with
67 // (e.g. the mouse hovers over a visible part of the out of focus window), a
68 // [`RequestRedraw`] event is received, or one sixtieth of a second has passed
69 // without the app updating (60 Hz refresh rate max).
70 WinitSettings::game()
71 }
72 Application => {
73 // While in `WinitSettings::desktop_app()` mode:
74 // * When focused: the app will update any time a winit event (e.g. the window is
75 // moved/resized, the mouse moves, a button is pressed, etc.), a [`RequestRedraw`]
76 // event is received, or after 5 seconds if the app has not updated.
77 // * When not focused: the app will update when the window is directly interacted with
78 // (e.g. the mouse hovers over a visible part of the out of focus window), a
79 // [`RequestRedraw`] event is received, or one minute has passed without the app
80 // updating.
81 WinitSettings::desktop_app()
82 }
83 ApplicationWithRequestRedraw => {
84 // Sending a `RequestRedraw` event is useful when you want the app to update the next
85 // frame regardless of any user input. For example, your application might use
86 // `WinitSettings::desktop_app()` to reduce power use, but UI animations need to play even
87 // when there are no inputs, so you send redraw requests while the animation is playing.
88 // Note that in this example the RequestRedraw winit event will make the app run in the same
89 // way as continuous
90 redraw_request_writer.write(RequestRedraw);
91 WinitSettings::desktop_app()
92 }
93 ApplicationWithWakeUp => {
94 // Sending a `WakeUp` event is useful when you want the app to update the next
95 // frame regardless of any user input. This can be used from outside Bevy, see example
96 // `window/custom_user_event.rs` for an example usage from outside.
97 // Note that in this example the `WakeUp` winit event will make the app run in the same
98 // way as continuous
99 let _ = event_loop_proxy.send_event(WakeUp);
100 WinitSettings::desktop_app()
101 }
102 };
103}Sourcepub fn desktop_app() -> WinitSettings
pub fn desktop_app() -> WinitSettings
Default settings for desktop applications.
Reactive if windows have focus,
reactive_low_power otherwise.
Use the EventLoopProxy to request a redraw from outside bevy.
Examples found in repository?
9fn main() {
10 App::new()
11 .add_plugins(DefaultPlugins)
12 .add_plugins(MeshPickingPlugin)
13 // Enable the FPS overlay with a high resolution refresh interval. This makes it
14 // easier to validate that UpdateMode is behaving correctly when desktop_app is used.
15 // The FPS counter should essentially pause when the cube is not rotating and should
16 // update rapidly when the cube is rotating or there is input (e.g. moving the mouse).
17 //
18 // Left and Right clicking the cube should roggle rotation on/off.
19 .add_plugins(FpsOverlayPlugin {
20 config: FpsOverlayConfig {
21 text_config: TextFont {
22 font_size: 12.0,
23 ..default()
24 },
25 text_color: Color::srgb(0.0, 1.0, 0.0),
26 refresh_interval: core::time::Duration::from_millis(16),
27 ..default()
28 },
29 })
30 .insert_resource(WinitSettings::desktop_app())
31 .add_systems(Startup, setup)
32 .add_systems(Update, (update, redraw.after(update)))
33 .run();
34}More examples
13fn main() {
14 App::new()
15 // Continuous rendering for games - bevy's default.
16 .insert_resource(WinitSettings::game())
17 // Power-saving reactive rendering for applications.
18 .insert_resource(WinitSettings::desktop_app())
19 // You can also customize update behavior with the fields of [`WinitSettings`]
20 .insert_resource(WinitSettings {
21 focused_mode: bevy::winit::UpdateMode::Continuous,
22 unfocused_mode: bevy::winit::UpdateMode::reactive_low_power(Duration::from_millis(10)),
23 })
24 .insert_resource(ExampleMode::Game)
25 .add_plugins(DefaultPlugins.set(WindowPlugin {
26 primary_window: Some(Window {
27 // Turn off vsync to maximize CPU/GPU usage
28 present_mode: PresentMode::AutoNoVsync,
29 ..default()
30 }),
31 ..default()
32 }))
33 .add_systems(Startup, test_setup::setup)
34 .add_systems(
35 Update,
36 (
37 test_setup::cycle_modes,
38 test_setup::rotate_cube,
39 test_setup::update_text,
40 update_winit,
41 ),
42 )
43 .run();
44}
45
46#[derive(Resource, Debug)]
47enum ExampleMode {
48 Game,
49 Application,
50 ApplicationWithRequestRedraw,
51 ApplicationWithWakeUp,
52}
53
54/// Update winit based on the current `ExampleMode`
55fn update_winit(
56 mode: Res<ExampleMode>,
57 mut winit_config: ResMut<WinitSettings>,
58 event_loop_proxy: Res<EventLoopProxyWrapper<WakeUp>>,
59 mut redraw_request_writer: MessageWriter<RequestRedraw>,
60) {
61 use ExampleMode::*;
62 *winit_config = match *mode {
63 Game => {
64 // In the default `WinitSettings::game()` mode:
65 // * When focused: the event loop runs as fast as possible
66 // * When not focused: the app will update when the window is directly interacted with
67 // (e.g. the mouse hovers over a visible part of the out of focus window), a
68 // [`RequestRedraw`] event is received, or one sixtieth of a second has passed
69 // without the app updating (60 Hz refresh rate max).
70 WinitSettings::game()
71 }
72 Application => {
73 // While in `WinitSettings::desktop_app()` mode:
74 // * When focused: the app will update any time a winit event (e.g. the window is
75 // moved/resized, the mouse moves, a button is pressed, etc.), a [`RequestRedraw`]
76 // event is received, or after 5 seconds if the app has not updated.
77 // * When not focused: the app will update when the window is directly interacted with
78 // (e.g. the mouse hovers over a visible part of the out of focus window), a
79 // [`RequestRedraw`] event is received, or one minute has passed without the app
80 // updating.
81 WinitSettings::desktop_app()
82 }
83 ApplicationWithRequestRedraw => {
84 // Sending a `RequestRedraw` event is useful when you want the app to update the next
85 // frame regardless of any user input. For example, your application might use
86 // `WinitSettings::desktop_app()` to reduce power use, but UI animations need to play even
87 // when there are no inputs, so you send redraw requests while the animation is playing.
88 // Note that in this example the RequestRedraw winit event will make the app run in the same
89 // way as continuous
90 redraw_request_writer.write(RequestRedraw);
91 WinitSettings::desktop_app()
92 }
93 ApplicationWithWakeUp => {
94 // Sending a `WakeUp` event is useful when you want the app to update the next
95 // frame regardless of any user input. This can be used from outside Bevy, see example
96 // `window/custom_user_event.rs` for an example usage from outside.
97 // Note that in this example the `WakeUp` winit event will make the app run in the same
98 // way as continuous
99 let _ = event_loop_proxy.send_event(WakeUp);
100 WinitSettings::desktop_app()
101 }
102 };
103}Sourcepub fn mobile() -> WinitSettings
pub fn mobile() -> WinitSettings
Default settings for mobile.
Reactive if windows have focus,
reactive_low_power otherwise.
Use the EventLoopProxy to request a redraw from outside bevy.
Sourcepub fn continuous() -> WinitSettings
pub fn continuous() -> WinitSettings
The application will update as fast possible.
Uses Continuous regardless of whether windows have focus.
Examples found in repository?
13fn main() {
14 App::new()
15 .add_plugins(DefaultPlugins.set(WindowPlugin {
16 primary_window: Some(Window {
17 present_mode: PresentMode::AutoNoVsync,
18 resolution: WindowResolution::new(1920, 1080).with_scale_factor_override(1.0),
19 ..default()
20 }),
21 ..default()
22 }))
23 .insert_resource(WinitSettings::continuous())
24 .add_systems(Startup, setup)
25 .add_systems(Update, rotate_cameras)
26 .run();
27}More examples
14fn main() {
15 App::new()
16 .add_plugins((
17 DefaultPlugins.set(WindowPlugin {
18 primary_window: Some(Window {
19 present_mode: PresentMode::AutoNoVsync,
20 resolution: WindowResolution::new(1920, 1080).with_scale_factor_override(1.0),
21 ..default()
22 }),
23 ..default()
24 }),
25 FrameTimeDiagnosticsPlugin::default(),
26 LogDiagnosticsPlugin::default(),
27 ))
28 .insert_resource(WinitSettings::continuous())
29 .add_systems(Startup, spawn)
30 .add_systems(Update, update_text_bounds)
31 .run();
32}19fn main() {
20 App::new()
21 .add_plugins((
22 DefaultPlugins.set(WindowPlugin {
23 primary_window: Some(Window {
24 resolution: WindowResolution::new(1920, 1080).with_scale_factor_override(1.0),
25 title: "many_lights".into(),
26 present_mode: PresentMode::AutoNoVsync,
27 ..default()
28 }),
29 ..default()
30 }),
31 FrameTimeDiagnosticsPlugin::default(),
32 LogDiagnosticsPlugin::default(),
33 LogVisibleLights,
34 ))
35 .insert_resource(WinitSettings::continuous())
36 .add_systems(Startup, setup)
37 .add_systems(Update, (move_camera, print_light_count))
38 .run();
39}14fn main() {
15 let mut app = App::new();
16 app.add_plugins((
17 DefaultPlugins.set(WindowPlugin {
18 primary_window: Some(Window {
19 title: "Many Debug Lines".to_string(),
20 present_mode: PresentMode::AutoNoVsync,
21 resolution: WindowResolution::new(1920, 1080).with_scale_factor_override(1.0),
22 ..default()
23 }),
24 ..default()
25 }),
26 FrameTimeDiagnosticsPlugin::default(),
27 LogDiagnosticsPlugin::default(),
28 ))
29 .insert_resource(WinitSettings::continuous())
30 .insert_resource(Config {
31 line_count: 50_000,
32 fancy: false,
33 })
34 .add_systems(Startup, setup)
35 .add_systems(Update, (input, ui_system));
36
37 for _ in 0..SYSTEM_COUNT {
38 app.add_systems(Update, system);
39 }
40
41 app.run();
42}34fn main() {
35 // `from_env` panics on the web
36 #[cfg(not(target_arch = "wasm32"))]
37 let args: Args = argh::from_env();
38 #[cfg(target_arch = "wasm32")]
39 let args = Args::from_args(&[], &[]).unwrap();
40
41 let mut app = App::new();
42 app.add_plugins((
43 DefaultPlugins.set(WindowPlugin {
44 primary_window: Some(Window {
45 present_mode: PresentMode::AutoNoVsync,
46 resolution: WindowResolution::new(1920, 1080).with_scale_factor_override(1.0),
47 ..default()
48 }),
49 ..default()
50 }),
51 FrameTimeDiagnosticsPlugin::default(),
52 LogDiagnosticsPlugin::default(),
53 ))
54 .insert_resource(WinitSettings::continuous())
55 .add_systems(Startup, setup);
56
57 if args.recompute_text {
58 app.add_systems(Update, force_text_recomputation);
59 }
60
61 app.insert_resource(args).run();
62}19fn main() {
20 App::new()
21 // Since this is also used as a benchmark, we want it to display performance data.
22 .add_plugins((
23 LogDiagnosticsPlugin::default(),
24 FrameTimeDiagnosticsPlugin::default(),
25 DefaultPlugins.set(WindowPlugin {
26 primary_window: Some(Window {
27 present_mode: PresentMode::AutoNoVsync,
28 resolution: WindowResolution::new(1920, 1080).with_scale_factor_override(1.0),
29 ..default()
30 }),
31 ..default()
32 }),
33 ))
34 .insert_resource(WinitSettings::continuous())
35 .add_systems(Startup, setup)
36 .add_systems(
37 Update,
38 (
39 animate_sprite,
40 print_sprite_count,
41 move_camera.after(print_sprite_count),
42 ),
43 )
44 .run();
45}Sourcepub fn update_mode(&self, focused: bool) -> UpdateMode
pub fn update_mode(&self, focused: bool) -> UpdateMode
Returns the current UpdateMode.
Note: The output depends on whether the window has focus or not.
Trait Implementations§
Source§impl Clone for WinitSettings
impl Clone for WinitSettings
Source§fn clone(&self) -> WinitSettings
fn clone(&self) -> WinitSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WinitSettings
impl Debug for WinitSettings
Source§impl Default for WinitSettings
impl Default for WinitSettings
Source§fn default() -> WinitSettings
fn default() -> WinitSettings
impl Resource for WinitSettings
Auto Trait Implementations§
impl Freeze for WinitSettings
impl RefUnwindSafe for WinitSettings
impl Send for WinitSettings
impl Sync for WinitSettings
impl Unpin for WinitSettings
impl UnwindSafe for WinitSettings
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.