Struct devela::ui::term::Ansi

source ·
pub struct Ansi;
Available on crate feature ui_term only.
Expand description

Implementations§

source§

impl Ansi

source§

impl Ansi

§Screen escape codes

source

pub const ENABLE_ALT_SCREEN: [u8; 7] = _

Code to enable the alternative screen.

source

pub const DISABLE_ALT_SCREEN: [u8; 7] = _

Code to disable the alternative screen.

source§

impl Ansi

§Erase escape codes

source

pub const ERASE_LINE_END: [u8; 3] = _

Code to erase from the cursor to the end of the line.

source

pub const ERASE_LINE_START: [u8; 4] = _

Code to erase from the cursor to the start of the line.

source

pub const ERASE_LINE: [u8; 4] = _

Code to erase the entire line.

source

pub const ERASE_SCREEN_END: [u8; 3] = _

Code to erase from the cursor to the end of the screen.

source

pub const ERASE_SCREEN_START: [u8; 4] = _

Code to erase from the cursor to the start of the screen.

source

pub const ERASE_SCREEN: [u8; 4] = _

Code to erase the entire screen.

source§

impl Ansi

§Cursor escape codes

source

pub const CURSOR_INVISIBLE: [u8; 6] = _

Code to make the cursor invisible.

source

pub const CURSOR_VISIBLE: [u8; 6] = _

Code to make the cursor visible.

source

pub const CURSOR_SAVE: [u8; 3] = _

Code to save the cursor position.

source

pub const CURSOR_RESTORE: [u8; 3] = _

Code to restore the cursor position.

source

pub const CURSOR_HOME: [u8; 3] = _

Code to move the cursor to the home position (1, 1).

source

pub const fn CURSOR_MOVE1(row: u8, col: u8) -> [u8; 6]

Code to move the cursor to the specified 1-digit position (row, col).

§Panics

Panics in debug if either row or col > 9.

source

pub const fn CURSOR_MOVE2(row: u8, col: u8) -> [u8; 8]

Code to move the cursor to the specified 2-digit position (row, col).

§Panics

Panics in debug if either row or col > 99.

source

pub const fn CURSOR_MOVE3(row: u16, col: u16) -> [u8; 10]

Code to move the cursor to the specified 3-digit position (row, col).

§Panics

Panics in debug if either row or col > 999.

source

pub const fn CURSOR_MOVE4(row: u16, col: u16) -> [u8; 12]

Code to move the cursor to the specified 4-digit position (row, col).

§Panics

Panics in debug if either row or col > 9999.

source

pub fn CURSOR_MOVE_N(buffer: &mut [u8], row: u32, col: u32) -> &[u8]

Returns a slice with the code to move the cursor to the specified position (row, col).

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source

pub const CURSOR_UP: [u8; 3] = _

Code to move the cursor up by one line.

source

pub const fn CURSOR_UP1(n: u8) -> [u8; 4]

Code to move the cursor up by 1-digit n lines.

§Panics

Panics in debug if n > 9.

source

pub const fn CURSOR_UP2(n: u8) -> [u8; 5]

Code to move the cursor up by 2-digit n lines.

§Panics

Panics in debug if n > 99.

source

pub const fn CURSOR_UP3(n: u16) -> [u8; 6]

Code to move the cursor up by 3-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub const fn CURSOR_UP4(n: u16) -> [u8; 7]

Code to move the cursor up by 4-digit n lines.

§Panics

Panics in debug if n > 9999.

source

pub fn CURSOR_UP_N(buffer: &mut [u8], n: u32) -> &[u8]

Returns a slice with the code to move the cursor up by n lines.

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source

pub const CURSOR_DOWN: [u8; 3] = _

Code to move the cursor down by one line.

source

pub const fn CURSOR_DOWN1(n: u8) -> [u8; 4]

Code to move the cursor down by 1-digit n lines.

§Panics

Panics in debug if n > 9.

source

pub const fn CURSOR_DOWN2(n: u8) -> [u8; 5]

Code to move the cursor down by 2-digit n lines.

§Panics

Panics in debug if n > 99.

source

pub const fn CURSOR_DOWN3(n: u16) -> [u8; 6]

Code to move the cursor down by 3-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub const fn CURSOR_DOWN4(n: u16) -> [u8; 7]

Code to move the cursor down by 4-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub fn CURSOR_DOWN_N(buffer: &mut [u8], n: u32) -> &[u8]

Returns a slice with the code to move the cursor down by n lines.

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source

pub const CURSOR_RIGHT: [u8; 3] = _

Code to move the cursor right by one column.

source

pub const fn CURSOR_RIGHT1(n: u8) -> [u8; 4]

Code to move the cursor right by 1-digit n lines.

§Panics

Panics in debug if n > 9.

source

pub const fn CURSOR_RIGHT2(n: u8) -> [u8; 5]

Code to move the cursor right by 2-digit n lines.

§Panics

Panics in debug if n > 99.

source

pub const fn CURSOR_RIGHT3(n: u16) -> [u8; 6]

Code to move the cursor right by 3-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub const fn CURSOR_RIGHT4(n: u16) -> [u8; 7]

Code to move the cursor right by 4-digit n lines.

§Panics

Panics in debug if n > 9999.

source

pub fn CURSOR_RIGHT_N(buffer: &mut [u8], n: u32) -> &[u8]

Returns a slice with the code to move the cursor right by n lines.

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source

pub const CURSOR_LEFT: [u8; 3] = _

Code to move the cursor left by one column.

source

pub const fn CURSOR_LEFT1(n: u8) -> [u8; 4]

Code to move the cursor left by 1-digit n lines.

§Panics

Panics in debug if n > 9.

source

pub const fn CURSOR_LEFT2(n: u8) -> [u8; 5]

Code to move the cursor left by 3-digit n lines.

§Panics

Panics in debug if n > 99.

source

pub const fn CURSOR_LEFT3(n: u16) -> [u8; 6]

Code to move the cursor left by 3-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub const fn CURSOR_LEFT4(n: u16) -> [u8; 7]

Code to move the cursor left by 4-digit n lines.

§Panics

Panics in debug if n > 9999.

source

pub fn CURSOR_LEFT_N(buffer: &mut [u8], n: u32) -> &[u8]

Returns a slice with the code to move the cursor left by n lines.

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source

pub const CURSOR_NEXT_LINE: [u8; 3] = _

Code to move the cursor to the beginning of the next line.

source

pub const fn CURSOR_NEXT_LINE1(n: u8) -> [u8; 4]

Code to move the cursor to the beginning of the next 1-digit n lines.

§Panics

Panics in debug if n > 9.

source

pub const fn CURSOR_NEXT_LINE2(n: u8) -> [u8; 5]

Code to move the cursor to the beginning of the next 2-digit n lines.

§Panics

Panics in debug if n > 99.

source

pub const fn CURSOR_NEXT_LINE3(n: u16) -> [u8; 6]

Code to move the cursor to the beginning of the next 3-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub const fn CURSOR_NEXT_LINE4(n: u16) -> [u8; 7]

Code to move the cursor to the beginning of the next 4-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub fn CURSOR_NEXT_LINE_N(buffer: &mut [u8], n: u32) -> &[u8]

Returns a slice with the code to move the cursor to the beginning of the next n lines.

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source

pub const CURSOR_PREV_LINE: [u8; 3] = _

Code to move the cursor to the beginning of the previous line.

source

pub const fn CURSOR_PREV_LINE1(n: u8) -> [u8; 4]

Code to move the cursor to the beginning of the previous 1-digit n lines.

§Panics

Panics in debug if n > 9.

source

pub const fn CURSOR_PREV_LINE2(n: u8) -> [u8; 5]

Code to move the cursor to the beginning of the previous 2-digit n lines.

§Panics

Panics in debug if n > 99.

source

pub const fn CURSOR_PREV_LINE3(n: u16) -> [u8; 6]

Code to move the cursor to the beginning of the previous 3-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub const fn CURSOR_PREV_LINE4(n: u16) -> [u8; 7]

Code to move the cursor to the beginning of the previous 4-digit n lines.

§Panics

Panics in debug if n > 999.

source

pub fn CURSOR_PREV_LINE_N(buffer: &mut [u8], n: u32) -> &[u8]

Returns a slice with the code to move the cursor to the beginning of the previous n lines.

It needs a buffer where to store the bytes.

§Panics

Panics if the buffer is not big enough.

source§

impl Ansi

§Font effects escape codes

source

pub const RESET: [u8; 4] = _

Code to turn off all effects and colors.

source

pub const BOLD: [u8; 4] = _

Code to set bold effect.

source

pub const BOLD_OFF: [u8; 5] = _

Code to unset bold and dim effects.

source

pub const DIM: [u8; 4] = _

Code to set dim effect.

source

pub const DIM_OFF: [u8; 5] = _

Code to unset bold and dim effects.

source

pub const ITALIC: [u8; 4] = _

Code to set italic effect.

source

pub const ITALIC_OFF: [u8; 5] = _

Code to unset italic and fraktur effects.

source

pub const UNDERLINE: [u8; 4] = _

Code to set underline effect.

source

pub const UNDERLINE_OFF: [u8; 5] = _

Code to unset underline effect.

Code to set blink effect.

Code to unset blink effect.

source

pub const INVERSE: [u8; 4] = _

Code to set inverse effect.

source

pub const INVERSE_OFF: [u8; 5] = _

Code to unset inverse effect.

source

pub const CROSSED: [u8; 4] = _

Code to set crossed effect.

source

pub const CROSSED_OFF: [u8; 5] = _

Code to unset crossed effect.

source§

impl Ansi

§3-bit Color escape codes

source

pub const fn COLORS(fg: AnsiColor3b, bg: AnsiColor3b) -> [u8; 8]

Code to set the foreground color to fg and the background to bg.

source

pub const fn COLORS_BRIGHT(fg: AnsiColor3b, bg: AnsiColor3b) -> [u8; 9]

Code to set the foreground color to bright fg and the background to bright bg.

source

pub const fn COLORS_BRIGHT_FG(fg: AnsiColor3b, bg: AnsiColor3b) -> [u8; 8]

Code to set the foreground color to bright fg and the background to bg.

source

pub const fn COLORS_BRIGHT_BG(fg: AnsiColor3b, bg: AnsiColor3b) -> [u8; 9]

Code to set the foreground color to fg and the background to bright bg.

source

pub const BLACK: [u8; 5] = _

Code to set the foreground color to black.

source

pub const RED: [u8; 5] = _

Code to set the foreground color to red.

source

pub const GREEN: [u8; 5] = _

Code to set the foreground color to green.

source

pub const YELLOW: [u8; 5] = _

Code to set the foreground color to yellow.

source

pub const BLUE: [u8; 5] = _

Code to set the foreground color to blue.

source

pub const MAGENTA: [u8; 5] = _

Code to set the foreground color to magenta.

source

pub const CYAN: [u8; 5] = _

Code to set the foreground color to cyan.

source

pub const WHITE: [u8; 5] = _

Code to set the foreground color to white.

source

pub const BLACK_BG: [u8; 5] = _

Code to set the background color to black.

source

pub const RED_BG: [u8; 5] = _

Code to set the background color to red.

source

pub const GREEN_BG: [u8; 5] = _

Code to set the background color to green.

source

pub const YELLOW_BG: [u8; 5] = _

Code to set the background color to yellow.

source

pub const BLUE_BG: [u8; 5] = _

Code to set the background color to blue.

source

pub const MAGENTA_BG: [u8; 5] = _

Code to set the background color to magenta.

source

pub const CYAN_BG: [u8; 5] = _

Code to set the background color to cyan.

source

pub const WHITE_BG: [u8; 5] = _

Code to set the background color to white.

source

pub const BRIGHT_BLACK: [u8; 5] = _

Code to set the foreground color to bright black.

source

pub const BRIGHT_RED: [u8; 5] = _

Code to set the foreground color to bright red.

source

pub const BRIGHT_GREEN: [u8; 5] = _

Code to set the foreground color to bright green.

source

pub const BRIGHT_YELLOW: [u8; 5] = _

Code to set the foreground color to bright yellow.

source

pub const BRIGHT_BLUE: [u8; 5] = _

Code to set the foreground color to bright blue.

source

pub const BRIGHT_MAGENTA: [u8; 5] = _

Code to set the foreground color to bright magenta.

source

pub const BRIGHT_CYAN: [u8; 5] = _

Code to set the foreground color to bright cyan.

source

pub const BRIGHT_WHITE: [u8; 5] = _

Code to set the foreground color to bright white.

source

pub const BRIGHT_BLACK_BG: [u8; 6] = _

Code to set the background color to bright black.

source

pub const BRIGHT_RED_BG: [u8; 6] = _

Code to set the background color to bright red.

source

pub const BRIGHT_GREEN_BG: [u8; 6] = _

Code to set the background color to bright green.

source

pub const BRIGHT_YELLOW_BG: [u8; 6] = _

Code to set the background color to bright yellow.

source

pub const BRIGHT_BLUE_BG: [u8; 6] = _

Code to set the background color to bright blue.

source

pub const BRIGHT_MAGENTA_BG: [u8; 6] = _

Code to set the background color to bright magenta.

source

pub const BRIGHT_CYAN_BG: [u8; 6] = _

Code to set the background color to bright cyan.

source

pub const BRIGHT_WHITE_BG: [u8; 6] = _

Code to set the background color to bright white.

source§

impl Ansi

§8-bit Color escape codes

source

pub const fn COLORS8(fg: AnsiColor8b, bg: AnsiColor8b) -> [u8; 19]

Code to set the foreground color to fg and the background to bg.

source

pub const fn COLOR8_FG(fg: AnsiColor8b) -> [u8; 11]

Code to set the foreground color to fg.

source

pub const fn COLOR8_BG(bg: AnsiColor8b) -> [u8; 11]

Code to set the background color to bg.

source

pub const fn GRAY(fg: u8, bg: u8) -> [u8; 19]

Code to set the foreground and background to 24-point grayscale.

A value of 0 is almost black, and 24 (or more) is almost white.

source

pub const GRAY0: [u8; 11] = _

ANSI gray foreground 0/23 8-bit color (4% white, 96% black).

source

pub const GRAY1: [u8; 11] = _

ANSI gray foreground 1/23 8-bit color (8% white, 92% black).

source

pub const GRAY2: [u8; 11] = _

ANSI gray foreground 2/23 8-bit color (12% white, 88% black).

source

pub const GRAY3: [u8; 11] = _

ANSI gray foreground 3/23 8-bit color (16% white, 84% black).

source

pub const GRAY4: [u8; 11] = _

ANSI gray foreground 4/23 8-bit color (20% white, 80% black).

source

pub const GRAY5: [u8; 11] = _

ANSI gray foreground 5/23 8-bit color (24% white, 76% black).

source

pub const GRAY6: [u8; 11] = _

ANSI gray foreground 6/23 8-bit color (28% white, 72% black).

source

pub const GRAY7: [u8; 11] = _

ANSI gray foreground 7/23 8-bit color (32% white, 68% black).

source

pub const GRAY8: [u8; 11] = _

ANSI gray foreground 8/23 8-bit color (36% white, 64% black).

source

pub const GRAY9: [u8; 11] = _

ANSI gray foreground 9/23 8-bit color (40% white, 60% black).

source

pub const GRAY10: [u8; 11] = _

ANSI gray foreground 10/23 8-bit color (44% white, 56% black).

source

pub const GRAY11: [u8; 11] = _

ANSI gray foreground 11/23 8-bit color (48% white, 52% black).

source

pub const GRAY12: [u8; 11] = _

ANSI gray foreground 12/23 8-bit color (52% white, 48% black).

source

pub const GRAY13: [u8; 11] = _

ANSI gray foreground 13/23 8-bit color (56% white, 44% black).

source

pub const GRAY14: [u8; 11] = _

ANSI gray foreground 14/23 8-bit color (60% white, 40% black).

source

pub const GRAY15: [u8; 11] = _

ANSI gray foreground 15/23 8-bit color (64% white, 36% black).

source

pub const GRAY16: [u8; 11] = _

ANSI gray foreground 16/23 8-bit color (68% white, 32% black).

source

pub const GRAY17: [u8; 11] = _

ANSI gray foreground 17/23 8-bit color (72% white, 28% black).

source

pub const GRAY18: [u8; 11] = _

ANSI gray foreground 18/23 8-bit color (76% white, 24% black).

source

pub const GRAY19: [u8; 11] = _

ANSI gray foreground 19/23 8-bit color (80% white, 20% black).

source

pub const GRAY20: [u8; 11] = _

ANSI gray foreground 20/23 8-bit color (84% white, 16% black).

source

pub const GRAY21: [u8; 11] = _

ANSI gray foreground 21/23 8-bit color (88% white, 12% black).

source

pub const GRAY22: [u8; 11] = _

ANSI gray foreground 22/23 8-bit color (92% white, 8% black).

source

pub const GRAY23: [u8; 11] = _

ANSI gray foreground 23/23 8-bit color (96% white, 4% black).

source

pub const GRAY0_BG: [u8; 11] = _

ANSI gray background 0/23 8-bit color (4% white, 96% black).

source

pub const GRAY1_BG: [u8; 11] = _

ANSI gray background 1/23 8-bit color (8% white, 92% black).

source

pub const GRAY2_BG: [u8; 11] = _

ANSI gray background 2/23 8-bit color (12% white, 88% black).

source

pub const GRAY3_BG: [u8; 11] = _

ANSI gray background 3/23 8-bit color (16% white, 84% black).

source

pub const GRAY4_BG: [u8; 11] = _

ANSI gray background 4/23 8-bit color (20% white, 80% black).

source

pub const GRAY5_BG: [u8; 11] = _

ANSI gray background 5/23 8-bit color (24% white, 76% black).

source

pub const GRAY6_BG: [u8; 11] = _

ANSI gray background 6/23 8-bit color (28% white, 72% black).

source

pub const GRAY7_BG: [u8; 11] = _

ANSI gray background 7/23 8-bit color (32% white, 68% black).

source

pub const GRAY8_BG: [u8; 11] = _

ANSI gray background 8/23 8-bit color (36% white, 64% black).

source

pub const GRAY9_BG: [u8; 11] = _

ANSI gray background 9/23 8-bit color (40% white, 60% black).

source

pub const GRAY10_BG: [u8; 11] = _

ANSI gray background 10/23 8-bit color (44% white, 56% black).

source

pub const GRAY11_BG: [u8; 11] = _

ANSI gray background 11/23 8-bit color (48% white, 52% black).

source

pub const GRAY12_BG: [u8; 11] = _

ANSI gray background 12/23 8-bit color (52% white, 48% black).

source

pub const GRAY13_BG: [u8; 11] = _

ANSI gray background 13/23 8-bit color (56% white, 44% black).

source

pub const GRAY14_BG: [u8; 11] = _

ANSI gray background 14/23 8-bit color (60% white, 40% black).

source

pub const GRAY15_BG: [u8; 11] = _

ANSI gray background 15/23 8-bit color (64% white, 36% black).

source

pub const GRAY16_BG: [u8; 11] = _

ANSI gray background 16/23 8-bit color (68% white, 32% black).

source

pub const GRAY17_BG: [u8; 11] = _

ANSI gray background 17/23 8-bit color (72% white, 28% black).

source

pub const GRAY18_BG: [u8; 11] = _

ANSI gray background 18/23 8-bit color (76% white, 24% black).

source

pub const GRAY19_BG: [u8; 11] = _

ANSI gray background 19/23 8-bit color (80% white, 20% black).

source

pub const GRAY20_BG: [u8; 11] = _

ANSI gray background 20/23 8-bit color (84% white, 16% black).

source

pub const GRAY21_BG: [u8; 11] = _

ANSI gray background 21/23 8-bit color (88% white, 12% black).

source

pub const GRAY22_BG: [u8; 11] = _

ANSI gray background 22/23 8-bit color (92% white, 8% black).

source

pub const GRAY23_BG: [u8; 11] = _

ANSI gray background 23/23 8-bit color (96% white, 4% black).

source§

impl Ansi

§RGB Color escape codes

source

pub const fn RGB(fg: [u8; 3], bg: [u8; 3]) -> [u8; 35]

Code to set the foreground color to fg: [r, g, b] values, and the background to bg: [r, g, b].

source

pub const fn RGB_FG(fg: [u8; 3]) -> [u8; 19]

Code to set the foreground color to fg: [r, g, b] values.

source

pub const fn RGB_BG(bg: [u8; 3]) -> [u8; 19]

Code to set the background color to bg: [r, g, b] values.

source§

impl Ansi

source

pub fn print(sequence: &[u8]) -> Result<()>

Available on crate feature std only.

Convenience method to print an ANSI escape sequence of bytes to stdout.

It uses the Write trait on std.

§Example
use devela::ui::term::{Ansi, AnsiColor3b};

Ansi::print(&Ansi::ERASE_SCREEN);
Ansi::print(&Ansi::CURSOR_MOVE3(120, 80));
Ansi::print(&Ansi::COLORS_BRIGHT_BG(AnsiColor3b::Blue, AnsiColor3b::Black));

Auto Trait Implementations§

§

impl Freeze for Ansi

§

impl RefUnwindSafe for Ansi

§

impl Send for Ansi

§

impl Sync for Ansi

§

impl Unpin for Ansi

§

impl UnwindSafe for Ansi

Blanket Implementations§

source§

impl<T> Also for T

source§

fn also_mut<F: FnOnce(&mut Self)>(self, f: F) -> Self

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
source§

fn also_ref<F: FnOnce(&Self)>(self, f: F) -> Self

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
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, Res> Apply<Res> for T
where T: ?Sized,

source§

fn apply<F: FnOnce(Self) -> Res>(self, f: F) -> Res
where Self: Sized,

Apply a function which takes the parameter by value.
source§

fn apply_ref<F: FnOnce(&Self) -> Res>(&self, f: F) -> Res

Apply a function which takes the parameter by shared reference.
source§

fn apply_mut<F: FnOnce(&mut Self) -> Res>(&mut self, f: F) -> Res

Apply a function which takes the parameter by exclusive reference.
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<T> ByteSize for T

source§

const BYTE_ALIGN: usize = _

The alignment of this type in bytes.
source§

const BYTE_SIZE: usize = _

The size of this type in bytes.
source§

const PTR_SIZE: usize = 8usize

The size of a pointer in bytes, for the current platform.
source§

fn byte_align(&self) -> usize

Returns the alignment of this type in bytes.
source§

fn byte_size(&self) -> usize

Returns the size of this type in bytes. Read more
source§

fn ptr_size_ratio(&self) -> [usize; 2]

Returns the size ratio between PTR_SIZE and BYTE_SIZE. Read more
source§

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

source§

fn type_of(&self) -> TypeId

Returns the TypeId of self. Read more
source§

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

Returns the type name of self. Read more
source§

fn type_is<T: 'static>(&self) -> bool

Returns true if Self is of type T. Read more
source§

fn as_any_ref(&self) -> &dyn Any
where Self: Sized,

Upcasts &self as &dyn Any. Read more
source§

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Upcasts &mut self as &mut dyn Any. Read more
source§

fn as_any_box(self: Box<Self>) -> Box<dyn Any>
where Self: Sized,

Upcasts Box<self> as Box<dyn Any>. Read more
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> Mem for T
where T: ?Sized,

source§

const NEEDS_DROP: bool = _

Whether dropping values of this type matters.
source§

fn mem_needs_drop(&self) -> bool

Returns true if dropping values of this type matters.
source§

fn mem_drop(self)
where Self: Sized,

Drops self by running its destructor.
source§

fn mem_forget(self)
where Self: Sized,

Forgets about self without running its destructor.
source§

fn mem_replace(&mut self, other: Self) -> Self
where Self: Sized,

Replaces self with other, returning the previous value of self.
source§

fn mem_take(&mut self) -> Self
where Self: Default,

Replaces self with its default value, returning the previous value of self.
source§

fn mem_swap(&mut self, other: &mut Self)
where Self: Sized,

Swaps the value of self and other without deinitializing either one.
source§

fn mem_as_bytes(&self) -> &[u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &[u8]. Read more
source§

fn mem_as_bytes_mut(&mut self) -> &mut [u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &mut [u8].
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.