Skip to main content

HelpSearchIndex

Struct HelpSearchIndex 

Source
pub struct HelpSearchIndex { /* private fields */ }
Expand description

A validated, owned view of the four matrices in Meta/hsearch.rds.

The matrices and their rows retain the stored order, duplicate values, empty strings, and R NA values. This is a metadata reader only: it does not implement utils::help.search() matching, ranking, or cross-package lookup policy.

Implementations§

Source§

impl HelpSearchIndex

Source

pub fn read_installed( package_dir: impl AsRef<Path>, ) -> Result<Option<Self>, Error>

Reads Meta/hsearch.rds below an explicitly named installed-package directory.

Ok(None) means that the file is absent. A present, valid empty index is returned as Ok(Some(index)); all decoding and schema errors are returned as errors.

Source

pub fn read_installed_with_options( package_dir: impl AsRef<Path>, options: &ReadOptions, ) -> Result<Option<Self>, Error>

Reads installed help-search metadata with explicit RDS read options.

Source

pub fn from_object(root: &RObject) -> Result<Self, Error>

Validates and copies a decoded Meta/hsearch.rds object.

The root must be an unnamed list of four character matrices. Current R schemas use Package, LibPath, ID, Name, Title, Topic, Encoding for the first matrix and singular Alias, Keyword, and Concept names for the remaining matrices. The known R 1.8/R 2.9-compatible lower-case topic columns, plural relation names, and six- or seven-column forms without or with Encoding are accepted as bounded compatibility cases. Matrix column order is resolved by column name, but unknown, missing, duplicate, or NA column names are rejected. A missing legacy Encoding column is represented as Some(""), matching R’s compatibility reader. Historical compatibility is limited to these documented shapes; this does not promise decoding every file produced by every old R release. RDS serialization versions 2 and 3 are accepted according to the profiles supported by rd-rds.

Source

pub fn base_entries( &self, ) -> impl ExactSizeIterator<Item = &HelpSearchBaseEntry>

Iterates over help-file rows in stored order.

Source

pub fn aliases(&self) -> impl ExactSizeIterator<Item = &HelpSearchAliasEntry>

Iterates over alias rows in stored order.

Source

pub fn keywords(&self) -> impl ExactSizeIterator<Item = &HelpSearchKeywordEntry>

Iterates over keyword rows in stored order.

Source

pub fn concepts(&self) -> impl ExactSizeIterator<Item = &HelpSearchConceptEntry>

Iterates over concept rows in stored order.

Source

pub fn base_len(&self) -> usize

Returns the number of help-file rows.

Source

pub fn aliases_len(&self) -> usize

Returns the number of stored alias rows.

Source

pub fn keywords_len(&self) -> usize

Returns the number of stored keyword rows.

Source

pub fn concepts_len(&self) -> usize

Returns the number of stored concept rows.

Source

pub fn is_empty(&self) -> bool

Returns whether all four matrices contain no rows.

Trait Implementations§

Source§

impl Clone for HelpSearchIndex

Source§

fn clone(&self) -> Self

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 HelpSearchIndex

Source§

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

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

impl Eq for HelpSearchIndex

Source§

impl PartialEq for HelpSearchIndex

Source§

fn eq(&self, other: &Self) -> 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 HelpSearchIndex

Source§

impl TryFrom<&RObject> for HelpSearchIndex

Source§

type Error = Error

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

fn try_from(value: &RObject) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

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