Skip to main content

Inspector

Struct Inspector 

Source
pub struct Inspector<C = ()> { /* private fields */ }
Expand description

The inspector of a client (Inspector in inspector/inspector.ts), from Zero::inspector.

zero-cache may require its admin password first: an RPC it refuses fails with an error saying so (JS prompts for the password instead). Once authenticate succeeds, the password is presented again when a new connection isn’t authenticated yet.

An RPC waits for the connection. It fails when the connection drops before the answer, and when the client closes.

Implementations§

Source§

impl<C> Inspector<C>

Source

pub fn client(&self) -> InspectorClient

This client.

Source

pub fn client_group(&self) -> InspectorClientGroup

This client’s group.

Source

pub fn metrics(&self) -> Deferred<Metrics> ⓘ

The client’s query metrics merged with the server’s (inspectorMetrics).

Source

pub fn clients(&self) -> Deferred<Vec<InspectorClient>> ⓘ

Every client in the local store.

Source

pub fn clients_with_queries(&self) -> Deferred<Vec<InspectorClient>> ⓘ

The clients in the local store the server has queries of: asks the server for each client’s queries.

Source

pub fn server_version(&self) -> Deferred<String> ⓘ

zero-cache’s version.

Source

pub fn analyze_query( &self, query: &impl ZeroQuery<C>, options: AnalyzeQueryOptions, ) -> Deferred<AnalyzeQueryResult> ⓘ

Asks the server to analyze query: by name and arguments for a named query, and by its AST, with the server’s names, otherwise.

Source

pub fn analyze_server_ast( &self, ast: &Ast, options: AnalyzeQueryOptions, ) -> Deferred<AnalyzeQueryResult> ⓘ

Asks the server to analyze ast, which is sent as is: it must have the server’s names.

Source

pub fn analyze_named_query( &self, name: &str, args: Vec<Value>, options: AnalyzeQueryOptions, ) -> Deferred<AnalyzeQueryResult> ⓘ

Asks the server to analyze the named query name with args, which its query handler resolves.

Source

pub fn authenticate(&self, password: &str) -> Deferred<bool> ⓘ

Authenticates with zero-cache’s admin password: true when it accepts it (or runs in a development mode that doesn’t check). zero-cache authenticates each connection; an accepted password is presented again on a new one.

Source

pub fn format_planner_events(&self, events: &[PlanDebugEvent]) -> String

The planner’s debug events (AnalyzeQueryResult::join_plans) as text: each attempt’s costs, then the plan chosen.

Trait Implementations§

Source§

impl<C> Clone for Inspector<C>

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

Auto Trait Implementations§

§

impl<C = ()> !RefUnwindSafe for Inspector<C>

§

impl<C = ()> !Send for Inspector<C>

§

impl<C = ()> !Sync for Inspector<C>

§

impl<C = ()> !UnwindSafe for Inspector<C>

§

impl<C> Forget for Inspector<C>

§

impl<C> Freeze for Inspector<C>
where Rc<C>: Freeze,

§

impl<C> Move for Inspector<C>

§

impl<C> Unpin for Inspector<C>
where Rc<C>: Unpin,

§

impl<C> UnsafeUnpin for Inspector<C>
where Rc<C>: UnsafeUnpin,

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.