Skip to main content

Alignments

Struct Alignments 

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

The alignment verdicts of every print, what decides them, and the frame each print’s last check was given.

Implementations§

Source§

impl Alignments

Source

pub fn new( state_dir: &Path, calibration: Option<Arc<CameraCalibration>>, prints: Arc<dyn PrintStore>, ) -> Result<Self>

The verdicts kept under one state directory.

§Errors

The filesystem’s own error when the directory cannot be made.

Source

pub fn calibration(&self) -> Option<&CameraCalibration>

The camera calibration in force, when one is configured.

Source

pub fn previous_check(&self, print_id: PrintId) -> Option<PreviousCheck>

The frame one print’s last check was given; nothing before its first check, or when the record cannot be read back.

Source

pub fn record_check(&self, print_id: PrintId, check: &PreviousCheck)

Name the frame one print’s check was given, which its next check shows as the previous. A record the filesystem refuses for a moment is replaced once the refusal passes ([replace_file]); one it goes on refusing is said on the log and leaves the record before it standing, so the next check shows an older frame as the previous rather than none. No test makes the refusal last: that needs the state directory made to refuse writes beneath a running server, which refuses the store’s own writes first. What a check makes of a record it cannot use — an empty panel 3 — is proved by a_lost_previous_frame_empties_panel_3_and_the_record_goes_with_the_print.

Source

pub fn print_alignment(&self, print_id: PrintId) -> PrintAlignment

One print’s verdict as it stands.

Source

pub async fn check( &self, supervisor: &Supervisor, active: ActiveJob, ) -> Option<PrintAlignment>

Rule on the running print’s alignment once its first object layer is down, when it has no verdict yet. Answers the verdict it wrote, and nothing when it wrote none — not yet due, or no good frame came.

Source

pub async fn sweep(&self)

Delete the verdict and the last check’s record of every print that is not open.

An open print’s record still being written — the .json.part beside it that [replace_file] renames over it — is its own, and kept: the watch sweeps after every read, so a sweep removing it between the write and the rename lost that record, and the print’s next check showed no previous frame.

A store that cannot list the open prints, a directory that cannot be listed and a file that cannot be removed each leave a verdict behind, which the next read’s sweep tries again. No test makes either refuse, since that needs a store or filesystem made to fail beneath a running server; the aligning journeys prove the sweep removes a closed print’s verdict and keeps an open one’s, after a close and at start.

Trait Implementations§

Source§

impl Debug for Alignments

Source§

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

Formats the value using the given formatter. Read more

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<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> ErasedDestructor for T
where T: 'static,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
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<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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