Skip to main content

RayRenderHandle

Struct RayRenderHandle 

Source
pub struct RayRenderHandle(/* private fields */);
Expand description

Mutex-guarded wrapper around RaylibHandle.

Implements Deref and DerefMut to the inner handle so raylib methods can be called directly on &RayRenderHandle. Input traits from cotis-utils are implemented on this type in crate::interactivity.

Methods from Deref<Target = RaylibHandle>§

Source

pub fn load_automation_event_list( &self, file_name: Option<PathBuf>, ) -> AutomationEventList

Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS

Source

pub fn set_automation_event_list(&self, l: &mut AutomationEventList)

Set automation event list to record to

Source

pub fn set_automation_event_base_frame(&self, b: i32)

Set automation event internal base frame to start recording

Source

pub fn start_automation_event_recording(&self)

Start recording automation events (AutomationEventList must be set)

Source

pub fn stop_automation_event_recording(&self)

Stop recording automation events

Source

pub fn set_trace_log_callback( &mut self, cb: fn(TraceLogLevel, &str), ) -> Result<(), SetCallbackError>

👎Deprecated:

Decoupled from RaylibHandle. Use set_trace_log_callback instead.

Set custom trace log

Source

pub fn set_save_file_data_callback( &mut self, cb: fn(&str, &[u8]) -> bool, ) -> Result<(), SetCallbackError>

👎Deprecated:

Decoupled from RaylibHandle. Use set_save_file_data_callback instead.

Set custom file binary data saver

Source

pub fn set_load_file_data_callback( &mut self, cb: fn(&str) -> Vec<u8>, ) -> Result<(), SetCallbackError>

👎Deprecated:

Decoupled from RaylibHandle. Use set_load_file_data_callback instead.

Set custom file binary data loader

Whatever you return from your callback will be intentionally leaked as Raylib is relied on to free it.

Source

pub fn set_save_file_text_callback( &mut self, cb: fn(&str, &str) -> bool, ) -> Result<(), SetCallbackError>

👎Deprecated:

Decoupled from RaylibHandle. Use set_save_file_text_callback instead.

Set custom file text data saver

Source

pub fn set_load_file_text_callback( &mut self, cb: fn(&str) -> String, ) -> Result<(), SetCallbackError>

👎Deprecated:

Decoupled from RaylibHandle. Use set_load_file_text_callback instead.

Set custom file text data loader

Whatever you return from your callback will be intentionally leaked as Raylib is relied on to free it.

Source

pub fn begin_drawing<'a>(&'a mut self, _: &RaylibThread) -> RaylibDrawHandle<'a>

Setup canvas (framebuffer) to start drawing. Prefer using the closure version, RaylibHandle::draw. This version returns a handle that calls raylib_sys::EndDrawing at the end of the scope and is provided as a fallback incase you run into issues with closures(such as lifetime or performance reasons)

Source

pub fn draw<'a>( &'a mut self, _: &RaylibThread, func: impl FnOnce(RaylibDrawHandle<'a>), )

Setup canvas (framebuffer) to start drawing.

Source

pub fn is_file_dropped(&self) -> bool

Checks if a file has been dropped into the window.

Source

pub fn is_file_extension<A>(&self, file_name: A, file_ext: A) -> bool
where A: Into<OsString>,

Checks a file’s extension.

Source

pub fn application_directory(&self) -> String

Get the directory of the running application.

Source

pub fn get_file_length<A>(&self, filename: A) -> i32
where A: Into<OsString>,

Get file length in bytes.

Any interior NUL bytes in filename are stripped before the FFI call.

Source

pub fn is_path_file<A>(&self, filename: A) -> bool
where A: Into<OsString>,

Check if a given path is a file or a directory

Any interior NUL bytes in filename are stripped before the FFI call.

Source

pub fn load_directory_files<A>(&self, dir_path: A) -> FilePathList
where A: Into<OsString>,

Load directory filepaths

Source

pub fn load_directory_files_ex<A>( &self, dir_path: A, filter: String, scan_sub_dirs: bool, ) -> FilePathList
where A: Into<OsString>,

Load directory filepaths with extension filtering and recursive directory scan

Source

pub fn load_dropped_files(&self) -> DroppedFilePathList

Check if a file has been dropped into window

Source

pub fn is_key_pressed(&self, key: KeyboardKey) -> bool

Detect if a key has been pressed once.

Source

pub fn is_key_pressed_repeat(&self, key: KeyboardKey) -> bool

Check if a key has been pressed again

Source

pub fn is_key_down(&self, key: KeyboardKey) -> bool

Detect if a key is being pressed.

Source

pub fn is_key_released(&self, key: KeyboardKey) -> bool

Detect if a key has been released once.

Source

pub fn is_key_up(&self, key: KeyboardKey) -> bool

Detect if a key is NOT being pressed.

Source

pub fn get_key_pressed(&mut self) -> Option<KeyboardKey>

Gets latest key pressed.

Source

pub fn get_key_pressed_number(&mut self) -> Option<u32>

Gets latest key pressed.

Source

pub fn get_char_pressed(&mut self) -> Option<char>

Gets latest char (unicode) pressed

Source

pub fn get_key_name(&self, key: KeyboardKey) -> Option<String>

Get the name of a key in keyboard-layout-aware form.

e.g. on an AZERTY keyboard, KeyboardKey::KEY_A returns "q". The C function returns a const char* into a static internal buffer; we copy it into an owned String immediately. Returns None if the pointer is null or the resulting string is empty / not valid UTF-8.

Source

pub fn set_exit_key(&mut self, key: Option<KeyboardKey>)

Sets a custom key to exit program (default is ESC).

Source

pub fn is_gamepad_available(&self, gamepad: i32) -> bool

Detect if a gamepad is available.

Source

pub fn get_gamepad_name(&self, gamepad: i32) -> Option<String>

Returns gamepad internal name id.

Source

pub fn is_gamepad_button_pressed( &self, gamepad: i32, button: GamepadButton, ) -> bool

Detect if a gamepad button has been pressed once.

Source

pub fn is_gamepad_button_down( &self, gamepad: i32, button: GamepadButton, ) -> bool

Detect if a gamepad button is being pressed.

Source

pub fn is_gamepad_button_released( &self, gamepad: i32, button: GamepadButton, ) -> bool

Detect if a gamepad button has been released once.

Source

pub fn is_gamepad_button_up(&self, gamepad: i32, button: GamepadButton) -> bool

Detect if a gamepad button is NOT being pressed.

Source

pub fn get_gamepad_button_pressed(&self) -> Option<GamepadButton>

Gets the last gamepad button pressed.

Source

pub fn get_gamepad_axis_count(&self, gamepad: i32) -> i32

Returns gamepad axis count for a gamepad.

Source

pub fn get_gamepad_axis_movement(&self, gamepad: i32, axis: GamepadAxis) -> f32

Returns axis movement value for a gamepad axis.

Source

pub fn is_mouse_button_pressed(&self, button: MouseButton) -> bool

Detect if a mouse button has been pressed once.

Source

pub fn is_mouse_button_down(&self, button: MouseButton) -> bool

Detect if a mouse button is being pressed.

Source

pub fn is_mouse_button_released(&self, button: MouseButton) -> bool

Detect if a mouse button has been released once.

Source

pub fn is_mouse_button_up(&self, button: MouseButton) -> bool

Detect if a mouse button is NOT being pressed.

Source

pub fn get_mouse_x(&self) -> i32

Returns mouse position X.

Source

pub fn get_mouse_y(&self) -> i32

Returns mouse position Y.

Source

pub fn get_mouse_position(&self) -> Vector2

Returns mouse position.

Source

pub fn get_mouse_delta(&self) -> Vector2

Returns mouse delta between frames.

Source

pub fn set_mouse_position(&mut self, position: impl Into<Vector2>)

Sets mouse position.

Source

pub fn set_mouse_offset(&mut self, offset: impl Into<Vector2>)

Sets mouse offset.

Source

pub fn set_mouse_scale(&mut self, scale_x: f32, scale_y: f32)

Sets mouse scaling.

Source

pub fn get_mouse_wheel_move(&self) -> f32

Get mouse wheel movement for X or Y, whichever is larger

Source

pub fn get_mouse_wheel_move_v(&self) -> Vector2

Get mouse wheel movement for both X and Y

Source

pub fn get_touch_x(&self) -> i32

Returns touch position X for touch point 0 (relative to screen size).

Source

pub fn get_touch_y(&self) -> i32

Returns touch position Y for touch point 0 (relative to screen size).

Source

pub fn get_touch_position(&self, index: u32) -> Vector2

Returns touch position XY for a touch point index (relative to screen size).

Source

pub fn set_gestures_enabled(&self, gesture_flags: u32)

Enables a set of gestures using flags.

Source

pub fn set_gamepad_mappings(&self, bind: &[i8]) -> i32

Set internal gamepad mappings (SDL_GameControllerDB)

Source

pub fn set_gamepad_vibration( &mut self, gamepad: i32, left_motor: f32, right_motor: f32, duration: f32, )

Set gamepad vibration for both motors

Source

pub fn is_gesture_detected(&self, gesture: Gesture) -> bool

Checks if a gesture have been detected.

Source

pub fn get_gesture_detected(&self) -> Gesture

Gets latest detected gesture.

Source

pub fn get_touch_point_id(&self, index: u32) -> i32

Get touch point identifier for given index

Source

pub fn get_touch_point_count(&self) -> u32

Gets touch points count.

Source

pub fn get_gesture_hold_duration(&self) -> f32

Gets gesture hold time in seconds.

Source

pub fn get_gesture_drag_vector(&self) -> Vector2

Gets gesture drag vector.

Source

pub fn get_gesture_drag_angle(&self) -> f32

Gets gesture drag angle.

Source

pub fn get_gesture_pinch_vector(&self) -> Vector2

Gets gesture pinch delta.

Source

pub fn get_gesture_pinch_angle(&self) -> f32

Gets gesture pinch angle.

Source

pub fn load_random_sequence<'a>( &self, num: Range<i32>, count: u32, ) -> RandomSequence<'a>

Load random values sequence, no values repeated

Source

pub fn load_image_from_screen(&self, _: &RaylibThread) -> Image

Load pixels from the screen into a CPU image

Source

pub fn take_screenshot(&mut self, _: &RaylibThread, filename: &str)

Takes a screenshot of current screen (saved a .png)

Source

pub fn get_random_value<T>(&self, num: RangeInclusive<i32>) -> T
where T: From<i32>,

Returns a random value between min and max (both included)

use raylib::*;
fn main() {
    let (mut rl, thread) = ...;
    let r = rl.get_random_value(0, 10);
    println!("random value: {}", r);
}
Source

pub fn set_random_seed(&mut self, seed: u32)

Set the seed for random number generation

Source

pub fn load_model( &mut self, _: &RaylibThread, filename: &str, ) -> Result<Model, LoadModelError>

Loads model from files (mesh and material).

Source

pub fn load_model_from_mesh( &mut self, _: &RaylibThread, mesh: WeakMesh, ) -> Result<Model, LoadModelError>

Loads model from a generated mesh

Source

pub fn load_model_animations( &mut self, _: &RaylibThread, filename: &str, ) -> Result<ModelAnimations, LoadModelAnimError>

Load model animations from file

Source

pub fn update_model_animation( &mut self, _: &RaylibThread, model: impl AsRef<Model>, anim: impl AsRef<ModelAnimation>, frame: f32, )

Update model animation pose (CPU)

Source

pub fn update_model_animation_ex( &mut self, _: &RaylibThread, model: impl AsRef<Model>, anim_a: impl AsRef<ModelAnimation>, frame_a: f32, anim_b: impl AsRef<ModelAnimation>, frame_b: f32, blend: f32, )

Update model animation pose, blending two animations (CPU).

New in raylib 6.0. blend (0.0..=1.0) interpolates between the pose of anim_a at frame_a and anim_b at frame_b.

Source

pub fn load_material_default(&self, _: &RaylibThread) -> WeakMaterial

Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)

Source

pub unsafe fn unload_material( &mut self, _: &RaylibThread, material: WeakMaterial, )

Unload material from GPU memory (VRAM)

§Safety

material must not be used after this call. Weak materials will leak memory if not unloaded.

Source

pub unsafe fn unload_model(&mut self, _: &RaylibThread, model: WeakModel)

Unload model from GPU memory (VRAM)

§Safety

model must not be used after this call. Weak models will leak memory if not unloaded.

Source

pub unsafe fn unload_mesh(&mut self, _: &RaylibThread, mesh: WeakMesh)

Unload mesh from GPU memory (VRAM)

§Safety

mesh must not be used after this call. Weak meshes will leak memory if not unloaded.

Source

pub fn load_shader( &mut self, _: &RaylibThread, vs_filename: Option<&str>, fs_filename: Option<&str>, ) -> Shader

Loads a custom shader and binds default locations.

Source

pub fn load_shader_from_memory( &mut self, _: &RaylibThread, vs_code: Option<&str>, fs_code: Option<&str>, ) -> Shader

Loads shader from code strings and binds default locations.

Source

pub fn set_matrix_projection( &mut self, _: &RaylibThread, proj: impl Into<Matrix>, )

Sets a custom projection matrix (replaces internal projection matrix).

Source

pub fn set_matrix_modelview( &mut self, _: &RaylibThread, view: impl Into<Matrix>, )

Sets a custom modelview matrix (replaces internal modelview matrix).

Source

pub fn get_matrix_modelview(&self) -> Matrix

Gets internal modelview matrix.

Source

pub fn get_matrix_projection(&self) -> Matrix

Gets internal projection matrix.

Source

pub fn unload_font(&mut self, font: WeakFont)

Unload font from GPU memory (VRAM)

Source

pub fn load_font( &mut self, _: &RaylibThread, filename: &str, ) -> Result<Font, LoadFontError>

Loads font from file into GPU memory (VRAM).

Source

pub fn load_font_ex( &mut self, _: &RaylibThread, filename: &str, font_size: i32, chars: Option<&str>, ) -> Result<Font, LoadFontError>

Loads font from file with extended parameters. Supplying None for chars loads the entire character set.

Source

pub fn load_font_from_image( &mut self, _: &RaylibThread, image: &Image, key: impl Into<Color>, first_char: i32, ) -> Result<Font, LoadFontError>

Load font from Image (XNA style)

Source

pub fn load_font_from_memory( &mut self, _: &RaylibThread, file_type: &str, file_data: &[u8], font_size: i32, chars: Option<&str>, ) -> Result<Font, LoadFontError>

Load font data from a given memory buffer. file_type refers to the extension, e.g. “.ttf”. You can pass Some(…) to chars to get the desired characters, or None to get the whole set.

Source

pub fn load_font_data( &mut self, data: &[u8], font_size: i32, chars: Option<&str>, sdf: i32, ) -> Option<GlyphInfo>

Loads font data for further use (see also Font::from_data). Now supports .tiff

Source

pub fn get_font_default(&self) -> WeakFont

Gets the default font.

Source

pub fn measure_text(&self, text: &str, font_size: i32) -> i32

Measures string width in pixels for default font.

Source

pub fn set_text_line_spacing(&self, spacing: i32)

Set vertical line spacing when drawing with line-breaks

Source

pub fn load_texture( &mut self, _: &RaylibThread, filename: &str, ) -> Result<Texture2D, LoadTextureError>

Loads texture from file into GPU memory (VRAM).

Source

pub fn load_texture_cubemap( &mut self, _: &RaylibThread, image: &Image, layout: CubemapLayout, ) -> Result<Texture2D, LoadTextureError>

Load cubemap from image, multiple image cubemap layouts supported

Source

pub fn load_texture_from_image( &mut self, _: &RaylibThread, image: &Image, ) -> Result<Texture2D, LoadTextureError>

Loads texture from image data.

Source

pub fn load_render_texture( &mut self, _: &RaylibThread, width: u32, height: u32, ) -> Result<RenderTexture2D, LoadTextureError>

Loads texture for rendering (framebuffer).

Source

pub unsafe fn unload_texture( &mut self, _: &RaylibThread, texture: WeakTexture2D, )

Unload texture from GPU memory (VRAM).

§Safety

texture must not be used after this call. Weak textures will leak memory if not unloaded.

Source

pub unsafe fn unload_render_texture( &mut self, _: &RaylibThread, texture: WeakRenderTexture2D, )

Unload render texture from GPU memory (VRAM).

§Safety

texture must not be used after this call. Weak render textures will leak if not unloaded.

Source

pub fn load_vr_stereo_config( &mut self, _: &RaylibThread, device: impl Into<VrDeviceInfo>, ) -> VrStereoConfig

Load VR stereo config for VR simulator device parameters

Source

pub fn get_clipboard_text(&self) -> Result<String, Utf8Error>

Get clipboard text content

Source

pub fn set_clipboard_text(&mut self, text: &str) -> Result<(), NulError>

Set clipboard text content

Source

pub fn get_screen_to_world_ray( &self, mouse_position: impl Into<Vector2>, camera: impl Into<Camera3D>, ) -> Ray

Get a ray trace from screen position (i.e mouse)

Source

pub fn get_screen_to_world_ray_ex( &self, mouse_position: impl Into<Vector2>, camera: impl Into<Camera3D>, width: i32, height: i32, ) -> Ray

Get a ray trace from screen position (i.e mouse) in a viewport

Source

pub fn get_world_to_screen( &self, position: impl Into<Vector3>, camera: impl Into<Camera3D>, ) -> Vector2

Returns the screen space position for a 3d world space position

Source

pub fn get_world_to_screen2D( &self, position: impl Into<Vector2>, camera: impl Into<Camera2D>, ) -> Vector2

Returns the screen space position for a 2d camera world space position

Source

pub fn get_world_to_screen_ex( &self, position: impl Into<Vector3>, camera: impl Into<Camera3D>, width: i32, height: i32, ) -> Vector2

Returns size position for a 3d world space position

Source

pub fn get_screen_to_world2D( &self, position: impl Into<Vector2>, camera: impl Into<Camera2D>, ) -> Vector2

Returns the world space position for a 2d camera screen space position

Source

pub fn set_target_fps(&mut self, fps: u32)

Set target FPS (maximum)

Source

pub fn get_fps(&self) -> u32

Returns current FPS

Source

pub fn get_frame_time(&self) -> f32

Returns time in seconds for last frame drawn

Source

pub fn get_time(&self) -> f64

Returns elapsed time in seconds since InitWindow()

Source

pub fn window_should_close(&self) -> bool

Checks if KEY_ESCAPE or Close icon was pressed. Do not call on web unless you are compiling with asyncify.

Source

pub fn is_window_ready(&self) -> bool

Checks if window has been initialized successfully.

Source

pub fn maximize_window(&mut self)

Set window state: maximized, if resizable

Source

pub fn minimize_window(&mut self)

Set window state: minimized, if resizable

Source

pub fn restore_window(&mut self)

Set window state: not minimized/maximized

Source

pub fn is_window_maximized(&self) -> bool

Check if window is currently maximized

Source

pub fn is_window_minimized(&self) -> bool

Checks if window has been minimized (or lost focus).

Source

pub fn is_window_resized(&self) -> bool

Checks if window has been resized.

Source

pub fn is_window_hidden(&self) -> bool

Checks if window has been hidden.

Source

pub fn is_window_fullscreen(&self) -> bool

Returns whether or not window is in fullscreen mode

Source

pub fn is_window_focused(&self) -> bool

Check if window is currently focused (only PLATFORM_DESKTOP)

Source

pub fn get_window_scale_dpi(&self) -> Vector2

Check if window is currently focused (only PLATFORM_DESKTOP)

Source

pub fn is_cursor_on_screen(&self) -> bool

Check if cursor is on the current screen.

Source

pub fn set_mouse_cursor(&self, cursor: MouseCursor)

Set mouse cursor

Source

pub fn toggle_fullscreen(&mut self)

Toggles fullscreen mode (only on desktop platforms).

Source

pub fn set_window_state(&mut self, state: WindowState)

Set window configuration state using flags

Source

pub fn clear_window_state(&mut self, state: WindowState)

Clear window configuration state flags

Source

pub fn get_window_state(&self) -> WindowState

Get the window config state

Source

pub fn set_window_icon(&mut self, image: impl AsRef<Image>)

Sets icon for window (only on desktop platforms).

Source

pub fn set_window_icons(&mut self, images: &mut [Image])

Set icon for window (multiple images, RGBA 32bit)

Source

pub fn set_window_title(&self, _: &RaylibThread, title: &str)

Sets title for window (only on desktop platforms).

Source

pub fn set_window_position(&mut self, x: i32, y: i32)

Sets window position on screen (only on desktop platforms).

Source

pub fn set_window_monitor(&mut self, monitor: i32)

Sets monitor for the current window (fullscreen mode).

Source

pub fn set_window_min_size(&mut self, width: i32, height: i32)

Sets minimum window dimensions (for FLAG_WINDOW_RESIZABLE).

Source

pub fn set_window_max_size(&mut self, width: i32, height: i32)

Sets maximum window dimensions (for FLAG_WINDOW_RESIZABLE).

Source

pub fn set_window_size(&mut self, width: i32, height: i32)

Sets window dimensions.

Source

pub fn set_window_opacity(&mut self, opacity: f32)

Set window opacity, value opacity is between 0.0 and 1.0

Source

pub fn get_render_width(&self) -> i32

Get current render width which is equal to screen width * dpi scale

Source

pub fn get_render_height(&self) -> i32

Get current render width which is equal to screen height * dpi scale

Source

pub fn get_screen_width(&self) -> i32

Get current screen width.

Source

pub fn get_screen_height(&self) -> i32

Gets current screen height.

Source

pub fn get_window_position(&self) -> Vector2

Get window position

Source

pub fn toggle_borderless_windowed(&self)

Toggle window state: borderless windowed (only on desktop platforms).

Source

pub fn set_window_focused(&self)

Focus the window (only on desktop platforms)

Source

pub fn show_cursor(&mut self)

Shows mouse cursor.

Source

pub fn hide_cursor(&mut self)

Hides mouse cursor.

Source

pub fn is_cursor_hidden(&self) -> bool

Checks if mouse cursor is not visible.

Source

pub fn enable_cursor(&mut self)

Enables mouse cursor (unlock cursor).

Source

pub fn disable_cursor(&mut self)

Disables mouse cursor (lock cursor).

Source

pub unsafe fn get_window_handle(&mut self) -> *mut c_void

Get native window handle

§Safety

The returned pointer is platform-specific and only valid as long as the window is open. The caller must not use the pointer after the raylib window is closed.

Trait Implementations§

Source§

impl Deref for RayRenderHandle

Source§

type Target = RaylibHandle

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for RayRenderHandle

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl MouseProvider for RayRenderHandle

Source§

fn get_mouse_position(&self) -> Vector2

Returns mouse position in pixel coordinates.
Source§

fn mouse_button_down(&self, button: MouseButton) -> bool

Returns whether the button is currently down.
Source§

fn get_mouse_wheel_move_v(&self) -> Vector2

Returns mouse wheel delta for the current frame. Read more
Source§

impl SimpleKeyboardProvider for RayRenderHandle

Source§

fn get_pressed_keys(&self) -> IndexSet<KeyboardKey>

Returns keys currently pressed.
Source§

impl SimpleTextProvider for RayRenderHandle

Source§

fn get_pressed_chars(&self) -> Vec<char>

Returns entered characters in backend-provided order.

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<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Source
where TailTarget: IsRenderList, Source: Embed<TailTarget, Idx>,

Source§

fn embed(self) -> RenderTList<H, TailTarget>

Converts self into Target.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

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.