pub enum Select {
Head(usize),
Tail(usize),
Picks(Vec<Pick>),
Changed {
by: Option<String>,
},
}Expand description
Which blocks of the agent view to print. Backs the read and
edit CLI flags -p, --head, --tail, and --changed (with
--by).
Variants§
Head(usize)
The first n blocks (--head N); a table is one block.
Tail(usize)
The last n blocks (--tail N).
Picks(Vec<Pick>)
Paragraphs and tables by id, in document order (-p).
Changed
The blocks that carry a tracked change or a comment (--changed);
with by, only those with that author’s marks (by is a handle
such as AC, with or without the @, or the author’s full name).
Implementations§
Source§impl Select
impl Select
Sourcepub fn from_flags(
paragraphs: Option<&str>,
head: Option<usize>,
tail: Option<usize>,
changed: bool,
by: Option<&str>,
) -> Result<Option<Select>, String>
pub fn from_flags( paragraphs: Option<&str>, head: Option<usize>, tail: Option<usize>, changed: bool, by: Option<&str>, ) -> Result<Option<Select>, String>
Selects the right Select variant from read’s CLI flags:
-p (paragraphs), --head, --tail, --changed with
--by, in that order of precedence. Returns Ok(None) when none
is given.
§Errors
An error string when:
--byis set without--changed;--changedis set with any of-p/--head/--tail;- the
--byvalue does not parse as an author (author); - the
-pspec does not parse as a paragraph / table selection (Self::parse).
Sourcepub fn parse(spec: &str) -> Result<Select, String>
pub fn parse(spec: &str) -> Result<Select, String>
p2, p5-p7, p17-, -p1, t0: comma-separated picks. A pick is a body
paragraph or a table, as the settled short ids spell them
(crate::ids::ShortId), or a range of paragraphs, which may be
open at one end (p17- to the end, -p1 from the start). An expired
spelling (12) is refused with its settled one. The open ends are
transitional: the 17 October 2026 contract retires them (closed
pN-pM ranges only); commas stay option-level separators.
Trait Implementations§
impl Eq for Select
impl StructuralPartialEq for Select
Auto Trait Implementations§
impl Forget for Select
impl Freeze for Select
impl Move for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnsafeUnpin for Select
impl UnwindSafe for Select
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.