Struct matcher_py::MatchResult

source ·
pub struct MatchResult<'a>(/* private fields */);
Expand description

A structure representing a match result from the Matcher.

This wraps around the MatchResultRs type from the matcher_rs library, allowing it to be used within this module’s context.

The lifetime parameter 'a ensures that the MatchResult does not outlive the data it references.

Trait Implementations§

source§

impl<'a> IntoPy<Py<PyAny>> for MatchResult<'a>

source§

fn into_py(self, py: Python<'_>) -> PyObject

Converts a MatchResult instance into a Python dictionary (PyObject).

This implementation of IntoPy enables MatchResult to be translated into a Python dictionary, making it accessible and manipulatable in the Python environment.

The resulting dictionary will have the following keys:

  • "match_id": The identifier for the match.
  • "table_id": The identifier for the table.
  • "word_id": The identifier for the word.
  • "word": The actual word as a string slice reference.
  • "similarity": The similarity score of the match.
§Parameters
  • self: The MatchResult instance to be converted.
  • py: The Python interpreter instance.
§Returns

A PyObject in the form of a Python dictionary, containing the match result details.

Auto Trait Implementations§

§

impl<'a> Freeze for MatchResult<'a>

§

impl<'a> RefUnwindSafe for MatchResult<'a>

§

impl<'a> Send for MatchResult<'a>

§

impl<'a> Sync for MatchResult<'a>

§

impl<'a> Unpin for MatchResult<'a>

§

impl<'a> UnwindSafe for MatchResult<'a>

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, 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> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
source§

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

§

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>,

§

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> Ungil for T
where T: Send,