Skip to main content

find_struct_impl

Function find_struct_impl 

Source
pub(crate) fn find_struct_impl(
    ctx: &AssistContext<'_, '_>,
    adt: &Adt,
    names: &[String],
) -> Option<Option<Impl>>
Expand description

find_struct_impl looks for impl of a struct, but this also has additional feature where it takes a list of function names and check if they exist inside impl_, if even one match is found, it returns None.

That means this function can have 3 potential return values:

  • None: an impl exists, but one of the function names within the impl matches one of the provided names.
  • Some(None): no impl exists.
  • Some(Some(_)): an impl exists, with no matching function names.