Toast
操作、閉じる、スワイプに対応した、時間制御される積み重ね通知を表示します。
デモを読み込み中…
toast_viewport("toasts").child(text("Saved"))#インポート
quickgui から Toast をインポートします。
use quickgui::*;#使い方
toast_viewport("toasts").child(text("Saved"))#構成
Toast::provider_partToast::portalToast::viewportToast::positionerToast::rootToast::contentToast::titleToast::descriptionToast::actionToast::close
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Toast
ソースを見るpub fn new(title: impl Into<Arc<str>>) -> SelfCreate a toast with an auto-dismiss duration of five seconds.
descriptionpub fn description(mut self, description: impl Into<Arc<str>>) -> Self—
Configures description for this part.
pub fn description(mut self, description: impl Into<Arc<str>>) -> Selfソースを見るactionpub fn action(mut self, action: impl Into<Arc<str>>) -> Self—
Label one caller-owned action control, such as *Undo*.
pub fn action(mut self, action: impl Into<Arc<str>>) -> Selfソースを見るkindpub const fn kind(mut self, kind: ToastKind) -> Self—
durationpub fn duration(mut self, duration: Duration) -> Self—
Replace the auto-dismiss duration, clamped to [`MAX_TOAST_DURATION`].
pub fn duration(mut self, duration: Duration) -> Selfソースを見るpersistentpub const fn persistent(mut self) -> Self—
titlepub fn title(&self) -> &Arc<str>—
description_textpub fn description_text(&self) -> Option<&Arc<str>>—
action_labelpub fn action_label(&self) -> Option<&Arc<str>>—
toast_kindpub const fn toast_kind(&self) -> ToastKind—
duration_valuepub const fn duration_value(&self) -> Option<Duration>—
Configures duration value for this part.
pub const fn duration_value(&self) -> Option<Duration>ソースを見るtoast_viewport
ソースを見るpub fn toast_viewport(id: impl Into<ElementId>) -> ElementCreate an unstyled toast-viewport root. This shorthand is equivalent to `ToastViewport::new(id).viewport_with(div())`.
