Skip to main content

Crate ratatui_comfy_toaster

Crate ratatui_comfy_toaster 

Source

Structs§

Toast
A simple widget that represents a toast message. It displays a message with a border colored according to the toast type.
ToastBuilder
A builder for creating a toast message. This struct allows you to specify the message content, type, position, and size constraints for a toast before showing it using the ToastEngine. The builder pattern provides a convenient way to configure the properties of a toast in a fluent manner.
ToastEngine
A toast engine for displaying temporary messages in a terminal UI. The ToastEngine manages the display of toasts, which are temporary messages that appear on the screen for a short duration. It supports different types of toasts (info, success, warning, error) and allows customization of their position and duration. You can call show_toast to display a toast, and hide_toast to hide the toast. To animate, you can get the area of the toast using toast_area and implement your animation logic based on that area. #[derive(Debug)] Caveat: If you’re not using the tokio feature, create a ToastEngine<()>. There is a (hacky) impl to make it work without the tokio feature.
ToastEngineBuilder
A builder for creating a ToastEngine. It allows you to set the default duration for toasts, and an optional channel sender for sending toast messages (if using the tokio feature).
ToastPlacement
ToastTitle
Title configuration carried through layout and rendering.

Enums§

ToastBorderMode
ToastConstraint
The constraint for the toast’s size. This enum defines how the size of the toast should be determined. The Auto variant allows the toast to automatically size itself based on the message content, while the Uniform and Manual variants allow for more specific control over the width and height of the toast.
ToastInteraction
ToastMessage
The messages that can be sent to the ToastEngine to control the display of toasts. The Show variant contains the message to display, the type of toast, and its position, while the Hide variant indicates that any currently displayed toast should be hidden.
ToastMouseButton
ToastPosition
The position on the screen where the toast should be displayed. This enum defines various positions for toasts, including top-left, top-right, bottom-left, bottom-right, and center. The ToastEngine uses this information to calculate the appropriate area for rendering the toast based on the specified position.
ToastPreset
Named title-layout presets for quick toast styling.
ToastProgressBarStyle
ToastShortcut
ToastTitleAlign
Horizontal placement of the title text.
ToastTitleLayout
How the title shares vertical space with the message body.
ToastTitleSeparator
Separator style for ToastTitleLayout::Gapped toasts.
ToastTitleStyle
Title foreground/background treatment.
ToastType
The type of toast to display. This enum defines the different types of toasts that can be shown, such as informational messages, success messages, warnings, and errors. Each variant can be styled differently when rendered.

Constants§

DEFAULT_BG
DEFAULT_POSITION

Functions§

contrasting_fg
dot_separator
line_separator
toast_content_padding
Per-side content padding inside the toast border.
toast_content_rows
toast_copy_text
toast_has_title
Inner content rows (excluding border/padding/progress chrome).
toast_vertical_padding_rows
Vertical padding rows counted in auto height (top + bottom).