Skip to main content

MediaQueryData

Struct MediaQueryData 

Source
pub struct MediaQueryData {
Show 27 fields pub size: Size, pub device_pixel_ratio: f64, pub text_scaler: TextScaler, pub platform_brightness: Brightness, pub view_insets: EdgeInsets, pub padding: EdgeInsets, pub view_padding: EdgeInsets, pub system_gesture_insets: EdgeInsets, pub always_use_24_hour_format: bool, pub accessible_navigation: bool, pub invert_colors: bool, pub high_contrast: bool, pub on_off_switch_labels: bool, pub disable_animations: bool, pub reduce_motion: bool, pub bold_text: bool, pub supports_announce: bool, pub navigation_mode: NavigationMode, pub gesture_settings: DeviceGestureSettings, pub supports_showing_system_context_menu: bool, pub line_height_scale_factor_override: Option<f64>, pub letter_spacing_override: Option<f64>, pub word_spacing_override: Option<f64>, pub paragraph_spacing_override: Option<f64>, pub display_corner_radii: Option<BorderRadius>, pub caption_style: Option<CaptionStyle>, pub title_bar_area: Option<TitleBarArea>,
}
Expand description

Information about a piece of media (e.g., a window).

For example, the size property contains the width and height of the current window.

To obtain individual attributes in a MediaQueryData, prefer to use the attribute-specific functions of MediaQuery over obtaining the entire MediaQueryData and accessing its members. Querying using MediaQuery::of will cause your widget to rebuild automatically whenever any field of the MediaQueryData changes (e.g., if the user rotates their device). Therefore, unless you are concerned with the entire MediaQueryData object changing, prefer using the specific methods (for example: MediaQuery::size_of and MediaQuery::padding_of), as it will rebuild more efficiently.

To obtain the entire current MediaQueryData for a given BuildContext, use the MediaQuery::of function. This can be useful if you are going to use copy_with to replace the MediaQueryData with one with an updated property.

§Insets and Padding

padding relates to view_padding and view_insets, in the simplest configuration, as the difference between the two. In cases when the view insets exceed the view padding, like when a software keyboard is shown below, padding goes to zero rather than a negative value. Therefore, padding is calculated by taking max(0.0, viewPadding - viewInsets).

MediaQueryData includes three EdgeInsets values: padding, view_padding, and view_insets. These values reflect the configuration of the device and are used and optionally consumed by widgets that position content within these insets. The padding value defines areas that might not be completely visible, like the display “notch” on the iPhone X. The view insets value defines areas that aren’t visible at all, typically because they’re obscured by the device’s keyboard. Similar to view insets, view padding does not differentiate padding in areas that may be obscured. For example, by using the view padding property, padding would defer to the iPhone “safe area” regardless of whether a keyboard is showing.

The view insets and view padding are independent values, they’re measured from the edges of the MediaQuery widget’s bounds. Together they inform the padding property. The bounds of the top level MediaQuery created by WidgetsApp are the same as the window that contains the app.

Widgets whose layouts consume space defined by view_insets, view_padding, or padding should enclose their children in secondary MediaQuery widgets that reduce those properties by the same amount. The remove_padding, remove_view_padding, and remove_view_insets methods are useful for this.

Dart’s named constructor arguments are the fluent setters (MediaQueryData::new().size(size).padding(padding)); copy_with clones for the same chain.

Fields§

§size: Size

The size of the media in logical pixels (e.g, the size of the screen).

Logical pixels are roughly the same visual size across devices. Physical pixels are the size of the actual hardware pixels on the device. The number of physical pixels per logical pixel is described by the device_pixel_ratio.

Prefer using MediaQuery::size_of over MediaQuery::of.size to get the size, since the former will only notify of changes in size, while the latter will notify for all MediaQueryData changes.

For widgets drawn in an Overlay, do not assume that the size of the Overlay is the size of the MediaQuery’s size. Nested overlays can have different sizes.

§Troubleshooting

It is considered bad practice to cache and later use the size returned by MediaQuery::size_of(app, context). It will make the application non-responsive and might lead to unexpected behaviors.

For instance, during startup, especially in release mode, the first returned size might be Size::ZERO. The size will be updated when the native platform reports the actual resolution. Using MediaQuery::size_of will ensure that when the size changes, any widgets depending on the size are automatically rebuilt.

§device_pixel_ratio: f64

The number of device pixels for each logical pixel of the encompassing view. This number might not be a power of two. Indeed, it might not even be an integer. For example, the Nexus 6 has a device pixel ratio of 3.5.

This property is typically only informational. Overriding this property does not rescale the app as the framework or its rendering pipeline usually does not read this value.

§text_scaler: TextScaler

The font scaling strategy to use for laying out textual contents.

If this MediaQueryData is created by the from_view constructor, this property reflects the platform’s preferred text scaling strategy, and may change as the user changes the scaling factor in the operating system’s accessibility settings.

See also:

§platform_brightness: Brightness

The current brightness mode of the host platform.

For example, starting in Android Pie, battery saver mode asks all apps to render in a “dark mode”.

Not all platforms necessarily support a concept of brightness mode. Those platforms will report Brightness::Light in this property.

See also:

§view_insets: EdgeInsets

The parts of the display that are completely obscured by system UI, typically by the device’s keyboard.

When a mobile device’s keyboard is visible view_insets.bottom corresponds to the top of the keyboard.

This value is independent of the padding and view_padding. View padding is measured from the edges of the MediaQuery widget’s bounds. Padding is calculated based on the view padding and view insets. The bounds of the top level MediaQuery created by WidgetsApp are the same as the window (often the mobile device screen) that contains the app.

§padding: EdgeInsets

The parts of the display that are partially obscured by system UI, typically by the hardware display “notches” or the system status bar.

If you consumed this padding (e.g. by building a widget that envelops or accounts for this padding in its layout in such a way that children are no longer exposed to this padding), you should remove this padding for subsequent descendants in the widget tree by inserting a new MediaQuery widget using the MediaQuery::remove_padding constructor.

Padding is derived from the values of view_insets and view_padding.

See also:

  • SafeArea, a widget that consumes this padding with a Padding widget and automatically removes it from the MediaQuery for its child.
§view_padding: EdgeInsets

The parts of the display that are partially obscured by system UI, typically by the hardware display “notches” or the system status bar.

This value remains the same regardless of whether the system is reporting other obstructions in the same physical area of the screen. For example, a software keyboard on the bottom of the screen that may cover and consume the same area that requires bottom padding will not affect this value.

This value is independent of the padding and view_insets: their values are measured from the edges of the MediaQuery widget’s bounds. The bounds of the top level MediaQuery created by WidgetsApp are the same as the window that contains the app. On mobile devices, this will typically be the full screen.

§system_gesture_insets: EdgeInsets

The areas along the edges of the display where the system consumes certain input events and blocks delivery of those events to the app.

Starting with Android Q, simple swipe gestures that start within the system_gesture_insets areas are used by the system for page navigation and may not be delivered to the app. Taps and swipe gestures that begin with a long-press are delivered to the app, but simple press-drag-release swipe gestures which begin within the area defined by system_gesture_insets may not be.

Apps should avoid locating gesture detectors within the system gesture insets area. Apps should feel free to put visual elements within this area.

This property is currently only expected to be set to a non-default value on Android starting with version Q.

§always_use_24_hour_format: bool

Whether to use 24-hour format when formatting time.

The behavior of this flag is different across platforms:

  • On Android this flag is reported directly from the user settings called “Use 24-hour format”. It applies to any locale used by the application, whether it is the system-wide locale, or the custom locale set by the application.
  • On iOS this flag is set to true when the user setting called “24-Hour Time” is set or the system-wide locale’s default uses 24-hour formatting.
  • On macOS this flag reflects the current system locale’s time format, which incorporates the “24-Hour Time” preference in System Settings. As on iOS, this only takes effect for the system locale; a custom locale passed to the application will ignore the 24-hour preference.
  • On Windows this flag is derived from the user’s “Short time” format in the Region settings; it is true when the configured format uses a 24-hour pattern.
  • On Linux this flag reflects the desktop environment’s clock-format setting where available (for example, org.gnome.desktop.interface.clock-format on GNOME). On desktops that do not expose such a setting, it defaults to true (24-hour).
  • On Web this flag is always false.
§accessible_navigation: bool

Whether the user is using an accessibility service like TalkBack or VoiceOver to interact with the application.

When this setting is true, features such as timeouts should be disabled or have minimum durations increased.

§invert_colors: bool

Whether the operating system is currently inverting the colors of the platform.

This flag indicates that the underlying OS is already performing a global color inversion at the screen level. It does not mean the framework will automatically invert its own layout painting.

Instead, this flag allows the application to react to the inversion. For example, by selectively re-inverting images, maps, or video playback so that they display with natural colors instead of looking like a film negative.

This flag is currently only updated on iOS devices.

§high_contrast: bool

Whether the platform is requesting a high contrast between foreground and background content.

On iOS, this corresponds to the “Increase Contrast” setting in Settings -> Accessibility. On Android, this corresponds to the “High contrast text” or similar accessibility settings.

This flag indicates that the operating system is already performing high-contrast adjustments or expects the application to adjust its color palette to meet higher accessibility standards.

This flag is currently only updated on iOS devices running iOS 13+ and Android devices running API 34+.

§on_off_switch_labels: bool

Whether the user requested to show on/off labels inside switches on iOS, via Settings -> Accessibility -> Display & Text Size -> On/Off Labels.

§disable_animations: bool

Whether the platform is requesting that animations be disabled or reduced as much as possible.

This corresponds to Android’s “Remove animations” accessibility setting.

On iOS, reduced motion is exposed separately via reduce_motion and does not set this flag.

Manually overriding this value in a MediaQuery widget will not affect framework animations (for example those driven by AnimationController). However, it can still be useful for testing or for custom widgets that explicitly read disable_animations.

When implementing custom explicit animations, you should check this property and adjust behavior accordingly (for example, by reducing duration or skipping non-essential animations when it is true).

§reduce_motion: bool

Whether the platform is requesting that animations be reduced or replaced with cross-fades in preference to motion effects.

This corresponds to the iOS “Reduce Motion” accessibility setting.

Unlike disable_animations, this flag does not automatically alter framework animations such as those controlled via AnimationController. Instead, it is intended to be read by widgets that want to tone down or replace non-essential motion, for example by substituting a cross-fade for a slide transition.

When implementing custom animations, you should check this property and adjust behavior accordingly; for example, by preferring a fade over movement when it is true.

§bold_text: bool

Whether the platform is requesting that text be drawn with a bold font weight.

§supports_announce: bool

Whether accessibility announcements (like SemanticsService.sendAnnouncement) are supported on the current platform.

Returns false on platforms where announcements are deprecated or unsupported by the underlying platform.

Returns true on platforms where such announcements are generally supported without discouragement. (iOS, web etc)

§navigation_mode: NavigationMode

Describes the navigation mode requested by the platform.

Some user interfaces are better navigated using a directional pad (DPAD) or arrow keys, and for those interfaces, some widgets need to handle these directional events differently. In order to know when to do that, these widgets will look for the navigation mode in effect for their context.

For instance, in a television interface, NavigationMode::Directional should be set, so that directional navigation is used to navigate away from a text field using the DPAD. In contrast, on a regular desktop application with the navigation_mode set to NavigationMode::Traditional, the arrow keys are used to move the cursor instead of navigating away.

The NavigationMode values indicate the type of navigation to be used in a widget subtree for those widgets sensitive to it.

§gesture_settings: DeviceGestureSettings

The gesture settings for the view this media query is derived from.

This contains platform specific configuration for gesture behavior, such as touch slop. These settings should be favored for configuring gesture behavior over the framework constants.

§supports_showing_system_context_menu: bool

Whether showing the system context menu is supported.

For example, on iOS 16.0 and above, the system text selection context menu may be shown instead of the framework-drawn context menu in order to avoid the iOS clipboard access notification when the “Paste” button is pressed.

§line_height_scale_factor_override: Option<f64>

Overrides the height of the text, as a multiple of the font size.

None when the platform has not set an override for text height.

See also:

  • Text, SelectableText, and EditableText, all of whose TextStyle.height and StrutStyle.height are overridden by this.
§letter_spacing_override: Option<f64>

Overrides the amount of space (in logical pixels) to add between each letter in a piece of text.

A negative value can be used to bring the letters closer.

None when the platform has not set an override for text letter spacing.

§word_spacing_override: Option<f64>

Overrides the amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word) in a piece of text.

A negative value can be used to bring the words closer.

None when the platform has not set an override for text word spacing.

§paragraph_spacing_override: Option<f64>

The amount of space (in logical pixels) to add following each paragraph in a piece of text.

None when the platform has not set an override for text paragraph spacing.

§display_corner_radii: Option<BorderRadius>

The radii of the display corners in logical pixels.

This is currently populated only on Android API 31+. On earlier Android versions, iOS, and other platforms, this value is None.

§caption_style: Option<CaptionStyle>

How the user’s system-wide settings say subtitles and captions look, which a SubtitleView merges into each cue it draws.

If this MediaQueryData is created by the from_view constructor, this property is the platform’s caption settings’ style, and changes as the user changes them; None where the platform keeps no caption settings, as Linux and the web keep none.

See also:

§title_bar_area: Option<TitleBarArea>

The strip along the top that the system’s window buttons sit in, in logical pixels, for a title bar to draw its items beside them: on an iPad window, the close, minimize and zoom buttons at its top left.

padding and view_padding already reach below the strip, so content laid out within them is clear of the buttons; only a widget that draws in the strip itself reads this. Removing the top padding removes it too, since what is laid out below the top is not in the strip.

If this MediaQueryData is created by the from_view constructor, this property is the view’s title bar area, and changes as the window enters or leaves full screen; None while no buttons are over the view.

See also:

Implementations§

Source§

impl MediaQueryData

Source

pub fn new() -> MediaQueryData

Creates data for a media query with explicit values.

In a typical application, calling this constructor directly is rarely needed. Consider using from_view to create data based on a view, or copy_with to create a new copy of MediaQueryData with updated properties from a base MediaQueryData.

Source

pub fn from_view( app: &App, view: &dyn EmbedderView, platform_data: Option<&MediaQueryData>, ) -> MediaQueryData

Creates data for a MediaQuery based on the given view.

If provided, the platform_data is used to fill in the platform-specific aspects of the newly created MediaQueryData. If platform_data is None, the platform (app.platform(), Dart’s view.platformDispatcher) is consulted to construct the platform-specific data.

Data which is exposed directly on the view is considered view-specific. Data which is only exposed via the platform is considered platform-specific.

Callers of this method should ensure that they also register for notifications so that the MediaQueryData can be updated when any data used to construct it changes (Dart’s WidgetsBindingObserver.didChangeMetrics, didChangeAccessibilityFeatures, didChangeTextScaleFactor, and didChangePlatformBrightness, which wait with the observer). The last three notifications are only relevant if no platform_data is provided. If platform_data is provided, callers should ensure to call this method again when it changes to keep the constructed MediaQueryData updated.

The platform here reports its brightness, its system context menu support, and the user’s caption style: the accessibility features, the 24-hour format, the text scale factor, and the text style overrides, as well as the view’s system gesture insets and display corner radii, keep their defaults until the embedder exposes them (see PORTING.md).

In general, MediaQuery::of, and its associated “…Of” methods, are the appropriate way to obtain MediaQueryData from a widget. This from_view constructor is primarily for use in the implementation of the framework itself.

See also:

  • MediaQuery::from_view, which constructs MediaQueryData from a provided view, makes it available to descendant widgets, and sets up the appropriate notification listeners to keep the data updated.
Source

pub fn size(self, size: Size) -> MediaQueryData

Dart MediaQueryData(size:).

Source

pub fn device_pixel_ratio(self, device_pixel_ratio: f64) -> MediaQueryData

Dart MediaQueryData(devicePixelRatio:).

Source

pub fn text_scaler(self, text_scaler: TextScaler) -> MediaQueryData

Dart MediaQueryData(textScaler:).

Source

pub fn platform_brightness( self, platform_brightness: Brightness, ) -> MediaQueryData

Dart MediaQueryData(platformBrightness:).

Source

pub fn padding(self, padding: EdgeInsets) -> MediaQueryData

Dart MediaQueryData(padding:).

Source

pub fn view_insets(self, view_insets: EdgeInsets) -> MediaQueryData

Dart MediaQueryData(viewInsets:).

Source

pub fn system_gesture_insets( self, system_gesture_insets: EdgeInsets, ) -> MediaQueryData

Dart MediaQueryData(systemGestureInsets:).

Source

pub fn view_padding(self, view_padding: EdgeInsets) -> MediaQueryData

Dart MediaQueryData(viewPadding:).

Source

pub fn always_use_24_hour_format( self, always_use_24_hour_format: bool, ) -> MediaQueryData

Dart MediaQueryData(alwaysUse24HourFormat:).

Source

pub fn accessible_navigation( self, accessible_navigation: bool, ) -> MediaQueryData

Dart MediaQueryData(accessibleNavigation:).

Source

pub fn invert_colors(self, invert_colors: bool) -> MediaQueryData

Dart MediaQueryData(invertColors:).

Source

pub fn high_contrast(self, high_contrast: bool) -> MediaQueryData

Dart MediaQueryData(highContrast:).

Source

pub fn on_off_switch_labels(self, on_off_switch_labels: bool) -> MediaQueryData

Dart MediaQueryData(onOffSwitchLabels:).

Source

pub fn disable_animations(self, disable_animations: bool) -> MediaQueryData

Dart MediaQueryData(disableAnimations:).

Source

pub fn reduce_motion(self, reduce_motion: bool) -> MediaQueryData

Dart MediaQueryData(reduceMotion:).

Source

pub fn bold_text(self, bold_text: bool) -> MediaQueryData

Dart MediaQueryData(boldText:).

Source

pub fn supports_announce(self, supports_announce: bool) -> MediaQueryData

Dart MediaQueryData(supportsAnnounce:).

Source

pub fn navigation_mode(self, navigation_mode: NavigationMode) -> MediaQueryData

Dart MediaQueryData(navigationMode:).

Source

pub fn gesture_settings( self, gesture_settings: DeviceGestureSettings, ) -> MediaQueryData

Dart MediaQueryData(gestureSettings:).

Source

pub fn supports_showing_system_context_menu( self, supports_showing_system_context_menu: bool, ) -> MediaQueryData

Dart MediaQueryData(supportsShowingSystemContextMenu:).

Source

pub fn line_height_scale_factor_override( self, line_height_scale_factor_override: f64, ) -> MediaQueryData

Dart MediaQueryData(lineHeightScaleFactorOverride:).

Source

pub fn letter_spacing_override( self, letter_spacing_override: f64, ) -> MediaQueryData

Dart MediaQueryData(letterSpacingOverride:).

Source

pub fn caption_style(self, caption_style: CaptionStyle) -> MediaQueryData

The user’s caption style; MediaQueryData has no counterpart in Dart.

Source

pub fn title_bar_area(self, title_bar_area: TitleBarArea) -> MediaQueryData

The strip the window buttons sit in; MediaQueryData has no counterpart in Dart.

Source

pub fn word_spacing_override(self, word_spacing_override: f64) -> MediaQueryData

Dart MediaQueryData(wordSpacingOverride:).

Source

pub fn paragraph_spacing_override( self, paragraph_spacing_override: f64, ) -> MediaQueryData

Dart MediaQueryData(paragraphSpacingOverride:).

Source

pub fn display_corner_radii( self, display_corner_radii: BorderRadius, ) -> MediaQueryData

Dart MediaQueryData(displayCornerRadii:).

Source

pub fn orientation(&self) -> Orientation

The orientation of the media (e.g., whether the device is in landscape or portrait mode).

Source

pub fn copy_with(&self) -> MediaQueryData

Creates a copy of this media query data but with the given fields replaced with the new values: chain the field setters on the result (data.copy_with().text_scaler(TextScaler::NO_SCALING)).

Source

pub fn apply_text_style_overrides( &self, line_height_scale_factor_override: Option<f64>, letter_spacing_override: Option<f64>, word_spacing_override: Option<f64>, paragraph_spacing_override: Option<f64>, ) -> MediaQueryData

Creates a copy of this media query data but with the line_height_scale_factor_override, letter_spacing_override, word_spacing_override, and paragraph_spacing_override replaced with the given values.

If an argument is None, then this MediaQueryData is returned with the corresponding override set to None.

See also:

Source

pub fn apply_display_corner_radii( &self, display_corner_radii: Option<BorderRadius>, ) -> MediaQueryData

Creates a copy of this media query data but with the display_corner_radii replaced with the given value.

If the argument is None, then this MediaQueryData is returned with the display_corner_radii set to None.

Source

pub fn remove_padding( &self, remove_left: bool, remove_top: bool, remove_right: bool, remove_bottom: bool, ) -> MediaQueryData

Creates a copy of this media query data but with the given paddings replaced with zero.

If all four of the remove_left, remove_top, remove_right, and remove_bottom arguments are false, then this MediaQueryData is returned unmodified.

See also:

Source

pub fn remove_view_insets( &self, remove_left: bool, remove_top: bool, remove_right: bool, remove_bottom: bool, ) -> MediaQueryData

Creates a copy of this media query data but with the given view_insets replaced with zero.

If all four of the remove_left, remove_top, remove_right, and remove_bottom arguments are false, then this MediaQueryData is returned unmodified.

See also:

Source

pub fn remove_view_padding( &self, remove_left: bool, remove_top: bool, remove_right: bool, remove_bottom: bool, ) -> MediaQueryData

Creates a copy of this media query data but with the given view_padding replaced with zero.

If all four of the remove_left, remove_top, remove_right, and remove_bottom arguments are false, then this MediaQueryData is returned unmodified.

See also:

Trait Implementations§

Source§

impl Clone for MediaQueryData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MediaQueryData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MediaQueryData

Source§

fn default() -> MediaQueryData

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

impl Display for MediaQueryData

Dart’s MediaQueryData.toString, which a MediaQuery dump prints.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MediaQueryData

Dart’s ==: the scalers compare by their textScaleFactor, not as scalers.

Source§

fn eq(&self, other: &MediaQueryData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. 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> 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
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

impl<T> Upcast<T> for T

Source§

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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