pub struct CommandOutputRange {
pub start_line: u64,
pub end_line: Option<u64>,
}Expand description
Inclusive global terminal line range for command output.
A running range has end_line == None; Self::finish installs an end no
earlier than the start. Public fields/deserialization can bypass that rule.
§Examples
use ailloli_ui_terminal_core::CommandOutputRange;
assert_eq!(CommandOutputRange::new(4).end_line, None);Fields§
§start_line: u64Inclusive first global terminal line.
end_line: Option<u64>Inclusive last line, or None while open/unknown.
Implementations§
Source§impl CommandOutputRange
impl CommandOutputRange
Sourcepub const fn new(start_line: u64) -> Self
pub const fn new(start_line: u64) -> Self
Creates an open range at an exact global line.
§Examples
use ailloli_ui_terminal_core::CommandOutputRange;
assert_eq!(CommandOutputRange::new(u64::MAX).start_line, u64::MAX);Sourcepub fn finish(&mut self, end_line: u64)
pub fn finish(&mut self, end_line: u64)
Closes the range, clamping an earlier end up to start_line.
Repeated calls replace the previous end.
§Examples
use ailloli_ui_terminal_core::CommandOutputRange;
let mut range = CommandOutputRange::new(10); range.finish(3);
assert_eq!(range.end_line, Some(10));Trait Implementations§
Source§impl Clone for CommandOutputRange
impl Clone for CommandOutputRange
Source§fn clone(&self) -> CommandOutputRange
fn clone(&self) -> CommandOutputRange
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandOutputRange
impl Debug for CommandOutputRange
Source§impl Default for CommandOutputRange
impl Default for CommandOutputRange
Source§impl<'de> Deserialize<'de> for CommandOutputRange
impl<'de> Deserialize<'de> for CommandOutputRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandOutputRange
impl PartialEq for CommandOutputRange
Source§impl Serialize for CommandOutputRange
impl Serialize for CommandOutputRange
impl Copy for CommandOutputRange
impl Eq for CommandOutputRange
impl StructuralPartialEq for CommandOutputRange
Auto Trait Implementations§
impl Freeze for CommandOutputRange
impl RefUnwindSafe for CommandOutputRange
impl Send for CommandOutputRange
impl Sync for CommandOutputRange
impl Unpin for CommandOutputRange
impl UnwindSafe for CommandOutputRange
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