Esc

get

procedureextension2 overloadssince 0.36.1Source
  • macOS: get works on macOS
  • Linux: get works on Linux
  • Windows: get works on Windows
  • Wasm: get works on Wasm

overload 1

get :: (message: *$E, extension: Extension(E, $T, $kind)) -> (T, bool)

Reads a singular extension. The last occurrence of a scalar wins, and message occurrences merge. Returns the default and false when absent. Strings, bytes and the strings inside a message point into the extendee's unknown fields, so they stay valid until it is changed, freed or decoded into. A message value owns blocks: release it with free.

overload 2

get :: (message: *$E, extension: Repeated_Extension(E, $T, $kind)) -> [..] T

Reads every element of a repeated extension in wire order; packed and expanded forms both count. The result is empty when absent. Release it with free. Elements follow the lifetime rules of get.

See also