Hint

Refer to QMK’s documentation for details on how to use community modules

generics

Generic types/functions.

OptionImpl(T)
[source]

Define a new option type.

Parameters:
  • T – The type of values.

Option(T)
[source]

Expresive type for operations that may return nothing.

is_some: Whether this option contains a value.

Some(T, v)
[source]

Create an option with the given value.

None(T)
[source]

Create an empty option.

ResultImpl(T, E)
[source]

Define a new result type.

Parameters:
  • T – The type of values.

  • E – The type of errors.

Result(T, E)
[source]

Expresive type for operations that may fail.

is_ok: Whether this result is a value or error.

Ok(T, E, v)
[source]

Create a result with the given value.

Err(T, E, e)
[source]

Create a result instance with the given error.

unwrap(option_or_result)
[source]

Get the value out of an Ok/Some value, halt if Err/None

unwrap_err(result)
[source]

Get the error out of an Err value, halt if Ok


RingBufferImpl(T)
[source]

Define a new ring buffer type.

Parameters:
  • T – The type of values.

RingBuffer(T)
[source]

Ring buffer type.

rbuf_from(T, buf)
[source]

Create a ring buffer around the given buffer.

Parameters:
  • T – The type of values.

  • buf – The buffer to wrap.

rbuf_push(rbuf, value)
[source]

Add an element.

rbuf_pop(rbuf)
[source]

Remove an element.

rbuf_has_data(rbuf)
[source]

Check emptiness.

rbuf_clear(rbuf)
[source]

Reset a buffer