pub struct BatchPermissionPanel { /* private fields */ }Expand description
State for the batch permission panel
Implementations§
Source§impl BatchPermissionPanel
impl BatchPermissionPanel
Sourcepub fn new() -> BatchPermissionPanel
pub fn new() -> BatchPermissionPanel
Create a new inactive batch permission panel
Sourcepub fn with_config(config: BatchPermissionPanelConfig) -> BatchPermissionPanel
pub fn with_config(config: BatchPermissionPanelConfig) -> BatchPermissionPanel
Create a new inactive batch permission panel with custom configuration
Sourcepub fn activate(
&mut self,
session_id: i64,
batch: BatchPermissionRequest,
turn_id: Option<TurnId>,
)
pub fn activate( &mut self, session_id: i64, batch: BatchPermissionRequest, turn_id: Option<TurnId>, )
Activate the panel with a batch permission request
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivate the panel
Sourcepub fn session_id(&self) -> i64
pub fn session_id(&self) -> i64
Get the session ID
Sourcepub fn batch(&self) -> &BatchPermissionRequest
pub fn batch(&self) -> &BatchPermissionRequest
Get the current batch request
Sourcepub fn selected_option(&self) -> BatchPermissionOption
pub fn selected_option(&self) -> BatchPermissionOption
Get the currently selected option
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection to the next option
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection to the previous option
Sourcepub fn process_key(&mut self, key: KeyEvent) -> BatchKeyAction
pub fn process_key(&mut self, key: KeyEvent) -> BatchKeyAction
Handle a key event
Sourcepub fn panel_height(&self, max_height: u16) -> u16
pub fn panel_height(&self, max_height: u16) -> u16
Calculate the height needed for the panel
Sourcepub fn render_panel(&self, frame: &mut Frame<'_>, area: Rect, theme: &Theme)
pub fn render_panel(&self, frame: &mut Frame<'_>, area: Rect, theme: &Theme)
Render the panel
Trait Implementations§
Source§impl Default for BatchPermissionPanel
impl Default for BatchPermissionPanel
Source§fn default() -> BatchPermissionPanel
fn default() -> BatchPermissionPanel
Returns the “default value” for a type. Read more
Source§impl Widget for BatchPermissionPanel
impl Widget for BatchPermissionPanel
Source§fn handle_key(
&mut self,
key: KeyEvent,
ctx: &WidgetKeyContext<'_>,
) -> WidgetKeyResult
fn handle_key( &mut self, key: KeyEvent, ctx: &WidgetKeyContext<'_>, ) -> WidgetKeyResult
Handle key event, return result indicating what action to take. Read more
Source§fn required_height(&self, max_height: u16) -> u16
fn required_height(&self, max_height: u16) -> u16
Calculate required height for this widget Read more
Source§fn blocks_input(&self) -> bool
fn blocks_input(&self) -> bool
Whether this widget blocks input to the text input when active
Source§fn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Whether this widget is a full-screen overlay Read more
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Cast to Any for mutable downcasting
Auto Trait Implementations§
impl Freeze for BatchPermissionPanel
impl RefUnwindSafe for BatchPermissionPanel
impl Send for BatchPermissionPanel
impl Sync for BatchPermissionPanel
impl Unpin for BatchPermissionPanel
impl UnwindSafe for BatchPermissionPanel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more