pub struct SimilaritySessionCompletion { /* private fields */ }Expand description
Stop requests, progress, and timing for a session run.
Implementations§
Source§impl SimilaritySessionCompletion
impl SimilaritySessionCompletion
Sourcepub fn new() -> Ref<Self>
pub fn new() -> Ref<Self>
Creates a new completion state, typically only done when calling into providers and resolvers directly instead of from a session.
pub unsafe fn from_raw(handle: *mut BNSimilaritySessionCompletion) -> Self
pub unsafe fn ref_from_raw( handle: *mut BNSimilaritySessionCompletion, ) -> Ref<Self>
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns whether the session run has finished.
Sourcepub fn progress(&self, query: SimilaritySessionCompletionQuery) -> f64
pub fn progress(&self, query: SimilaritySessionCompletionQuery) -> f64
Returns progress for the selected part of the run from 0.0 through 1.0.
Sourcepub fn request_stop(&self)
pub fn request_stop(&self)
Asks the run to stop.
Sourcepub fn is_stop_requested(&self) -> bool
pub fn is_stop_requested(&self) -> bool
Returns whether a stop has been requested.
Sourcepub fn set_progress(
&self,
query: SimilaritySessionCompletionQuery,
progress: f64,
)
pub fn set_progress( &self, query: SimilaritySessionCompletionQuery, progress: f64, )
Increases progress for a node and one provider or resolver. Progress cannot decrease.
NOTE: Only call this from the provider or resolver selected by the query.
Sourcepub fn timing(&self, query: SimilaritySessionCompletionQuery) -> Duration
pub fn timing(&self, query: SimilaritySessionCompletionQuery) -> Duration
Returns timing for the selected part of the run.
Trait Implementations§
Source§impl ToOwned for SimilaritySessionCompletion
impl ToOwned for SimilaritySessionCompletion
Source§type Owned = Ref<SimilaritySessionCompletion>
type Owned = Ref<SimilaritySessionCompletion>
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Send for SimilaritySessionCompletion
impl Sync for SimilaritySessionCompletion
Auto Trait Implementations§
impl Freeze for SimilaritySessionCompletion
impl RefUnwindSafe for SimilaritySessionCompletion
impl Unpin for SimilaritySessionCompletion
impl UnsafeUnpin for SimilaritySessionCompletion
impl UnwindSafe for SimilaritySessionCompletion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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