View Source AhoCorasickNif (aho_corasick_nif v0.1.0-beta.1)

A NIF wrapper for the Rust crate aho-corasick-nif.

This module provides a NIF wrapper for the Rust crate aho-corasick-nif. The NIFs are implemented in Rust and exposed to Elixir via the Rustler library.

Summary

Types

@type t() :: Types.automata()

Functions

Link to this function

add_patterns(ac, patterns)

View Source
@spec add_patterns(t(), binary() | [binary()]) :: :ok | {:error, Types.errors()}
Link to this function

add_patterns!(ac, patterns)

View Source
@spec add_patterns!(t(), binary() | [binary()]) :: :ok
@spec find_all(t(), binary()) ::
  {:ok, [AhoCorasickNif.Native.Match.t()]} | {:error, Types.errors()}
@spec find_all!(t(), binary()) :: [AhoCorasickNif.Native.Match.t()]
Link to this function

find_all_overlapping(ac, haystack)

View Source
@spec find_all_overlapping(t(), binary()) ::
  {:ok, [AhoCorasickNif.Native.Match.t()]} | {:error, Types.errors()}
Link to this function

find_all_overlapping!(ac, haystack)

View Source
@spec find_all_overlapping!(t(), binary()) :: [AhoCorasickNif.Native.Match.t()]
Link to this function

find_first(ac, haystack)

View Source
@spec find_first(t(), binary()) ::
  {:ok, AhoCorasickNif.Native.Match.t() | nil} | {:error, Types.errors()}
@spec is_match(t(), binary()) :: {:ok, boolean()} | {:error, Types.errors()}
@spec is_match!(t(), binary()) :: boolean()
@spec new(AhoCorasickNif.Native.BuilderOptions.t(), binary() | [binary()]) ::
  {:ok, t()} | {:error, Types.errors()}
Link to this function

remove_patterns(ac, patterns)

View Source
@spec remove_patterns(t(), binary() | [binary()]) :: :ok | {:error, Types.errors()}
Link to this function

remove_patterns!(ac, patterns)

View Source
@spec remove_patterns!(t(), binary() | [binary()]) :: :ok
Link to this function

replace_all(ac, haystack, replacements)

View Source
@spec replace_all(t(), binary(), replacements :: [binary()]) ::
  {:ok, binary()} | {:error, Types.errors()}
Link to this function

replace_all!(ac, haystack, replacements)

View Source
@spec replace_all!(t(), binary(), replacements :: [binary()]) :: binary()