Skip to main content

EverythingClient

Struct EverythingClient 

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

Everything IPC client

See wm for details.

Implementations§

Source§

impl EverythingClient

Source

pub fn get_folder_size<'f1, 'f2>( &'f1 self, path: &'f2 Path, ) -> EverythingClientGetFolderSizeBuilder<'f1, 'f2>

A convenient query wrapper that get the size of a folder.

See also folder::size.

Source§

impl EverythingClient

Source

pub fn new() -> Result<Self, IpcError>

Create a new Everything client

Source

pub fn with_instance(instance_name: Option<&str>) -> Result<Self, IpcError>

Create a new Everything client with instance name

Source§

impl EverythingClient

Source

pub fn query<'f1, 'f2>( &'f1 self, search: &'f2 str, ) -> EverythingClientQueryBuilder<'f1, 'f2>

Send a query to Everything

§Important Note

Everything only handles one query per window at a time. Sending another query when a query has not completed will cancel the old query.

This method serializes queries by replacing the previous sender. Callers should wait for the receiver before calling again.

§Example
use std::time::Duration;
use everything_ipc::wm::{EverythingClient, RequestFlags};

let everything = EverythingClient::new().unwrap();

// These queries will be serialized (not sent concurrently)
let receiver1 = everything
    .query("search1")
    .request_flags(RequestFlags::FileName)
    .call()
    .unwrap();
let result1 = receiver1.recv_timeout(Duration::from_secs(5)).unwrap();

// Now safe to send next query
let receiver2 = everything
    .query("search2")
    .request_flags(RequestFlags::FileName)
    .call()
    .unwrap();
let result2 = receiver2.recv_timeout(Duration::from_secs(5)).unwrap();
Source

pub fn query_wait<'f1, 'f2>( &'f1 self, search: &'f2 str, ) -> EverythingClientQueryWaitBuilder<'f1, 'f2>

Send a query to Everything and wait for the result

This method serializes queries to work around Everything’s single-query-per-window limitation. Only one query can be sent at a time per reply window.

Source§

impl EverythingClient

Source

pub fn query_tokio<'f1, 'f2>( &'f1 self, search: &'f2 str, ) -> EverythingClientQueryTokioBuilder<'f1, 'f2>

Send a query to Everything asynchronously

§Important Note

Everything only handles one query per window at a time. Sending another query when a query has not completed will cancel the old query.

This method serializes queries by replacing the previous sender. Callers should await the receiver before calling again.

§Example
use everything_ipc::wm::{EverythingClient, RequestFlags};

let everything = EverythingClient::new().unwrap();

// These queries will be serialized (not sent concurrently)
let receiver1 = everything
    .query_tokio("search1")
    .request_flags(RequestFlags::FileName)
    .call()?;
let result1 = receiver1.await?;

// Now safe to send next query
let receiver2 = everything
    .query_tokio("search2")
    .request_flags(RequestFlags::FileName)
    .call()?;
let result2 = receiver2.await?;
Source

pub fn query_wait_tokio<'f1, 'f2>( &'f1 self, search: &'f2 str, ) -> EverythingClientQueryWaitTokioBuilder<'f1, 'f2>

Send a query to Everything asynchronously and wait for the result

This method serializes queries to work around Everything’s single-query-per-window limitation. Only one query can be sent at a time per reply window.

Methods from Deref<Target = IpcWindow>§

Source

pub fn wm_client(&self) -> Result<EverythingClient, IpcError>

Source

pub fn hwnd(&self) -> HWND

[HWND] of the IPC window.

Source

pub fn class_name(&self) -> &str

Class name of the IPC window.

Source

pub fn instance_name(&self) -> Option<&str>

Source

pub fn is_ipc_available(&self) -> bool

Check if IPC is available

Source

pub fn get_version(&self) -> Version

Get the version of Everything

Source

pub fn is_db_loaded(&self) -> bool

Check if the database is loaded

Source

pub fn is_file_info_indexed(&self, info: FileInfo) -> bool

Check if info is indexed

Trait Implementations§

Source§

impl Deref for EverythingClient

Source§

type Target = IpcWindow

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more