proof_of_sql::base::database::table_utility

Function borrowed_int

Source
pub fn borrowed_int<S: Scalar>(
    name: impl Deref<Target = str>,
    data: impl IntoIterator<Item = impl Into<i32>>,
    alloc: &Bump,
) -> (Identifier, Column<'_, S>)
Expand description

Creates a (Identifier, Column) pair for an int column. This is primarily intended for use in conjunction with table.

§Example

use bumpalo::Bump;
use proof_of_sql::base::{database::table_utility::*, scalar::Curve25519Scalar};
let alloc = Bump::new();
let result = table::<Curve25519Scalar>([
    borrowed_int("a", [1, 2, 3], &alloc),
]);

§Panics

  • Panics if name.parse() fails to convert the name into an Identifier.