Skip to main content

Frame

Struct Frame 

Source
pub struct Frame { /* private fields */ }
Expand description

渲染系统相关功能 帧

Implementations§

Source§

impl Frame

Source

pub fn new() -> Self

创建新的帧

Source

pub fn render_button(&mut self, label: &str, area: Rect, style: Style)

渲染按钮

Source

pub fn render_input( &mut self, text: &str, cursor_pos: usize, area: Rect, style: Style, cursor_style: Style, focused: bool, )

渲染输入框

Source

pub fn render_list( &mut self, items: &[ListItem], selected: usize, area: Rect, style: Style, )

渲染列表

Source

pub fn render_table( &mut self, header: Option<&Row>, rows: &[Row], selected: usize, area: Rect, style: Style, )

渲染表格

Source

pub fn render_panel( &mut self, title: Option<&str>, area: Rect, style: Style, border_style: Style, )

渲染面板

Source

pub fn render_progress_bar( &mut self, current: u64, total: u64, width: u16, area: Rect, style: Style, filled_style: Style, )

渲染进度条

Source

pub fn render_loading_animation( &mut self, message: &str, frame: &str, area: Rect, style: Style, )

渲染加载动画

Source

pub fn render_select_menu( &mut self, prompt: &str, items: &[SelectItem], selected: usize, area: Rect, style: Style, )

渲染选择菜单

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnsafeUnpin for Frame

§

impl UnwindSafe for Frame

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