Skip to main content

Select

Enum Select 

Source
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).

Fields

§by: Option<String>

The author whose marks a block must hold.

Implementations§

Source§

impl Select

Source

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:

  • --by is set without --changed;
  • --changed is set with any of -p / --head / --tail;
  • the --by value does not parse as an author (author);
  • the -p spec does not parse as a paragraph / table selection (Self::parse).
Source

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§

Source§

impl Clone for Select

Source§

fn clone(&self) -> Select

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Select

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for Select

Source§

impl PartialEq for Select

Source§

fn eq(&self, other: &Select) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.