pub struct SearchRequest {
pub envelope_version: u32,
pub pattern: String,
pub search_path: String,
pub mode: SearchMode,
pub kind: Option<String>,
pub lang: Option<String>,
pub limit: Option<u32>,
pub include_generated: bool,
}Expand description
daemon/search request payload.
Submitted as the params field of a JsonRpcRequest with
method == "daemon/search". Wire-compatible with --exact, regex, and
fuzzy search modes; the daemon handler dispatches to the same
find_by_exact_name / regex / fuzzy logic the in-process CLI uses
(verifiable by the DAEMON_SEARCH_TESTS parity assertions).
Errors: a request whose search_path does not resolve to a
daemon-loaded workspace returns WorkspaceEvicted (-32004) or
WorkspaceNotLoaded; an incompatible plugin selection returns
WorkspaceIncompatibleGraph (-32005). The CLI shim treats either as
a soft failure and falls through to the in-process path.
Fields§
§envelope_version: u32Wire envelope version. Defaults to ENVELOPE_VERSION for
forward-compatible serde when the field is absent.
pattern: StringPattern to search for. Interpreted per mode.
search_path: StringWorkspace root the search should resolve against. The daemon
normalises and looks this up via WorkspaceManager.
mode: SearchModeSearch interpretation mode. Maps to the CLI’s --exact / --fuzzy
flags; everything else falls into SearchMode::Regex.
kind: Option<String>Optional kind filter (e.g. "function", "class"). Matches
the in-process Cli::kind semantics.
lang: Option<String>Optional language filter (e.g. "rust", "python").
limit: Option<u32>Maximum result count. None lets the daemon apply its default
(mirrors Cli::limit).
include_generated: boolMirror of the CLI’s --include-generated flag (default in-process:
false — macro-generated symbols are dropped). When false the
daemon applies the same filter_nodes_by_macro_boundary contract
as sqry-cli/src/commands/search.rs::run_regular_search so the
daemon route does not surface macro-generated symbols the
in-process path would have dropped.
Serde default is true for backward compatibility — a request
body that omits the field gets the same “no filter” behaviour
the tier-2 daemon handler shipped with originally (the
DAEMON_SEARCH_HANDLER unit’s approved tests rely on that
default and continue to pass without modification).
Trait Implementations§
Source§impl Clone for SearchRequest
impl Clone for SearchRequest
Source§fn clone(&self) -> SearchRequest
fn clone(&self) -> SearchRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchRequest
impl Debug for SearchRequest
Source§impl<'de> Deserialize<'de> for SearchRequest
impl<'de> Deserialize<'de> for SearchRequest
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>,
Source§impl PartialEq for SearchRequest
impl PartialEq for SearchRequest
Source§fn eq(&self, other: &SearchRequest) -> bool
fn eq(&self, other: &SearchRequest) -> bool
self and other values to be equal, and is used by ==.