csquery v1.0.0 CSQuery.OperatorOption View Source

A struct representing an option for one of the structured query syntax operators.

During expression construction, options that are not recognized for a given operator will either be discarded (if already a CSQuery.OperatorOption struct) or be treated as a named field (if part of a keyword list). Options that do not have a string value will be discarded.

Link to this section Summary

Types

Valid option names

t()

The struct for CSQuery.OperatorOption

Valid option values

Functions

Provide a CSQuery.OperatorOption struct (or nil)

Return a CSQuery.OperatorOption struct, or nil based on the name and value provided

Return a string value representation of the CSQuery.OperatorOption struct

Link to this section Types

Link to this type names() View Source
names() :: :boost | :distance | :field

Valid option names.

Link to this type t() View Source
t() :: %CSQuery.OperatorOption{name: names(), value: values()}

The struct for CSQuery.OperatorOption.

Link to this type values() View Source
values() :: nil | String.t()

Valid option values.

Link to this section Functions

Link to this function new(value) View Source
new(t()) :: t()
new({names(), any()}) :: t() | nil

Provide a CSQuery.OperatorOption struct (or nil).

new/1 is mostly used during expression list construction. See new/2 for more information.

Link to this function new(name, value) View Source
new(names(), nil) :: nil
new(atom(), any()) :: nil
new(names(), any()) :: t() | nil

Return a CSQuery.OperatorOption struct, or nil based on the name and value provided.

new/2 may return nil if:

  • the name is not in names/0;
  • the value is nil;
  • or the value does not conform to the String.Chars protocol.
Link to this function to_value(operator_option) View Source

Return a string value representation of the CSQuery.OperatorOption struct.

The response format will be "name=value". If the struct value is nil or does not conform to the String.Chars protocol, the response will be "".