Skip to main content

Driver

Struct Driver 

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

The embedding thread and what it shares with the service.

Implementations§

Source§

impl Driver

Source

pub fn start( storage: Arc<Mutex<Storage>>, worker: Arc<dyn Worker>, bounds: Bounds, writer_wait: Duration, ) -> Result<Self, Failure>

Start the thread over storage with worker, restarted as Restart::default says: every field declared on every live branch waits.

§Errors

The declared fields unread, or the thread unstarted, by name.

Source

pub fn start_with( storage: Arc<Mutex<Storage>>, worker: Arc<dyn Worker>, bounds: Bounds, writer_wait: Duration, restart: Restart, ) -> Result<Self, Failure>

As Self::start, with the worker started again as restart says.

§Errors

The declared fields unread, or the thread unstarted, by name.

Source

pub fn start_apart( storage: Arc<Mutex<Storage>>, worker: Arc<dyn Worker>, questions: Option<Arc<dyn Worker>>, bounds: Bounds, writer_wait: Duration, restart: Restart, ) -> Result<Self, Failure>

As Self::start_with, with questions asked of questions when it is given, never of the walk’s worker (SL1). The question worker never commits, so it never takes the admission (JOIN1).

§Errors

The declared fields unread, or the thread unstarted, by name.

Source

pub fn wrote(&self, branch: &str, collection: &str)

A write on branch touched collection: each field declared there waits, once.

Source

pub fn declared(&self, branch: &str, collection: &str, field: &str)

field of collection on branch was declared: it is known, and its walk waits.

Source

pub fn asker(&self) -> Result<&dyn Ask, Failure>

The worker, for a question, once it is ready: a search that finds none ready waits for one up to embed_ready_ms, on the driver’s signal, with no storage lock held.

§Errors

embed_worker_starting before the worker first answered; embed_worker_restarting while one that died is started again.

Source

pub fn field_status( &self, branch: &str, collection: &str, field: &str, ) -> &'static str

What vectors.fields says of a field this driver serves: the worker’s state while it is not ready, else whether its walk is open.

Source

pub fn longer_than_model( &self, branch: &str, collection: &str, field: &str, ) -> u64

EMB1: the records of a field this driver has given no vector since the service started, because the model reads only part of their text.

Source

pub fn embed_input_empty( &self, branch: &str, collection: &str, field: &str, ) -> u64

EMB-E1: the records of a field this driver has passed with no vector since the service started, because their text is empty or only whitespace (embed_input_empty).

Source

pub fn windows(&self, branch: &str, collection: &str, field: &str) -> (u64, u64)

EMB-E2: the records of a field this driver has given windows, and those given none for needing more than the cap, since it started.

Source

pub fn field_failure( &self, branch: &str, collection: &str, field: &str, ) -> Option<Value>

Source

pub fn walk_open(&self, branch: &str, collection: &str, field: &str) -> bool

Whether the walk of a field is still open as far as this driver knows: it waits, or a page of it is being made.

Source

pub fn status(&self) -> Value

The driver’s state for the service’s status answer.

Source§

impl Driver

Source

pub fn stop(&self) -> Result<(), Failure>

HANG1: tell the threads to stop and wait for them on their own signals, for at most [stop_within] in all: a page under way ends its worker calls and its commit, and no new one starts. A thread still running then is named and left, never waited on for ever. Each thread is waited on once; a later call finds nothing to wait for.

§Errors

embed_thread_unended, naming each thread that did not end in time.

Trait Implementations§

Source§

impl Debug for Driver

Source§

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

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

impl Drop for Driver

Source§

fn drop(&mut self)

Driver::stop; a thread it leaves is named on the service’s standard error, the one place a drop can say it.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Freeze for Driver

§

impl !RefUnwindSafe for Driver

§

impl !UnwindSafe for Driver

§

impl Send for Driver

§

impl Sync for Driver

§

impl Unpin for Driver

§

impl UnsafeUnpin for Driver

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
Source§

impl<T> IntoOption<T> for T

Source§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
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