pub(crate) struct SerializedSearchIndex {
names: Vec<String>,
path_data: Vec<Option<PathData>>,
entry_data: Vec<Option<EntryData>>,
descs: Vec<String>,
function_data: Vec<Option<FunctionData>>,
alias_pointers: Vec<Option<usize>>,
type_data: Vec<Option<TypeData>>,
generic_inverted_index: Vec<Vec<Vec<u32>>>,
crate_paths_index: FxHashMap<(ItemType, Vec<Symbol>), usize>,
}
Fields§
§names: Vec<String>
§path_data: Vec<Option<PathData>>
§entry_data: Vec<Option<EntryData>>
§descs: Vec<String>
§function_data: Vec<Option<FunctionData>>
§alias_pointers: Vec<Option<usize>>
§type_data: Vec<Option<TypeData>>
§generic_inverted_index: Vec<Vec<Vec<u32>>>
inverted index of generics
-
The outermost list has one entry per alpha-normalized generic.
-
The second layer is sorted by number of types that appear in the type signature. The search engine iterates over these in order from smallest to largest. Functions with less stuff in their type signature are more likely to be what the user wants, because we never show functions that are missing parts of the query, so removing..
-
The final layer is the list of functions.
crate_paths_index: FxHashMap<(ItemType, Vec<Symbol>), usize>
Implementations§
Source§impl SerializedSearchIndex
impl SerializedSearchIndex
fn load( doc_root: &Path, resource_suffix: &str, ) -> Result<SerializedSearchIndex, Error>
fn push( &mut self, name: String, path_data: Option<PathData>, entry_data: Option<EntryData>, desc: String, function_data: Option<FunctionData>, type_data: Option<TypeData>, alias_pointer: Option<usize>, ) -> usize
Sourcefn add_entry(
&mut self,
name: Symbol,
entry_data: EntryData,
desc: String,
) -> usize
fn add_entry( &mut self, name: Symbol, entry_data: EntryData, desc: String, ) -> usize
Add potential search result to the database and return the row ID.
The returned ID can be used to attach more data to the search result.
fn push_path(&mut self, name: String, path_data: PathData) -> usize
fn push_type( &mut self, name: String, path_data: PathData, type_data: TypeData, ) -> usize
fn push_alias(&mut self, name: String, alias_pointer: usize) -> usize
fn get_id_by_module_path(&mut self, path: &[Symbol]) -> usize
pub(crate) fn union( self, other: &SerializedSearchIndex, ) -> SerializedSearchIndex
pub(crate) fn sort(self) -> SerializedSearchIndex
pub(crate) fn write_to( self, doc_root: &Path, resource_suffix: &str, ) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for SerializedSearchIndex
impl Clone for SerializedSearchIndex
Source§fn clone(&self) -> SerializedSearchIndex
fn clone(&self) -> SerializedSearchIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SerializedSearchIndex
impl Debug for SerializedSearchIndex
Source§impl Default for SerializedSearchIndex
impl Default for SerializedSearchIndex
Source§fn default() -> SerializedSearchIndex
fn default() -> SerializedSearchIndex
Source§impl<'de> Deserialize<'de> for SerializedSearchIndex
impl<'de> Deserialize<'de> for SerializedSearchIndex
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>,
Auto Trait Implementations§
impl Freeze for SerializedSearchIndex
impl RefUnwindSafe for SerializedSearchIndex
impl Send for SerializedSearchIndex
impl Sync for SerializedSearchIndex
impl Unpin for SerializedSearchIndex
impl UnwindSafe for SerializedSearchIndex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 224 bytes