Skip to main content

Module bit_string

Module bit_string 

Source
Expand description

SQL bit-string input, length constraints and output over Core’s packed values.

Enums§

BitStringKind
Fixed and varying declarations share a value representation, but have different input and assignment constraints.

Functions§

coerce_with_control
Apply assignment or explicit-cast length semantics without changing the borrowed source or allocating an unpacked temporary.
from_integer_with_control
Convert an int4 or int8 value already checked by the caller’s integer-type owner. A widened int4 has the same sign-extension and low-bit behavior as int8.
from_packed_with_control
Copy network-order packed input, discarding unused low padding bits as PostgreSQL’s binary input does. The span contains exactly the bytes needed for the logical length.
input_with_control
Interpret binary or hexadecimal input. An input function checks the declared length before inspecting digits; explicit casts apply their modifier after unconstrained input instead.
output_with_control
Emit exactly the logical bits, preserving leading zeroes and partial final bytes under the invoking output allowance.
to_bigint
Interpret at most 64 bits as int8. The fixed upper bound requires no traversal scratch or retained allocation.
to_integer
Interpret at most 32 bits as int4. Shorter inputs are unsigned; the full width preserves its sign bit.