arcis 0.13.1

A standard library of types and functions for writing MPC circuits with the Arcis framework.
Documentation
//! Marker traits accepted by the arcis interpreter.
//!
//! The traits in this module are documentation-only handles: they exist so
//! rustdoc renders a page per trait, with an auto-generated implementors list
//! showing which types the arcis interpreter recognizes the trait on.
//!
//! They are never imported by user code. The interpreter treats `Copy` as an
//! implicit property of the listed types; you do not need to bring this trait
//! into scope.

/// `Copy` membership recognized by the arcis interpreter.
///
/// # Implementing
///
/// User types gain `Copy` via [`#[derive(Copy, Clone)]`](https://doc.rust-lang.org/std/marker/trait.Copy.html#how-can-i-implement-copy).
/// A hand-written `impl Copy for MyType` is **not** accepted — the
/// interpreter's forbidden-trait list rejects it.
///
/// # Implementors
///
/// The impl list below shows the types the interpreter recognizes as `Copy`.
/// User types with `#[derive(Copy, Clone)]` are accepted at use sites but do
/// not appear in this list (their impls live in user code, not in arcis).
pub trait Copy: crate::std::clone::Clone {}

// ---- Primitives ----

impl Copy for crate::std::boolean::bool {}

impl Copy for crate::std::integer::u8 {}
impl Copy for crate::std::integer::u16 {}
impl Copy for crate::std::integer::u32 {}
impl Copy for crate::std::integer::u64 {}
impl Copy for crate::std::integer::u128 {}
impl Copy for crate::std::integer::usize {}

impl Copy for crate::std::integer::i8 {}
impl Copy for crate::std::integer::i16 {}
impl Copy for crate::std::integer::i32 {}
impl Copy for crate::std::integer::i64 {}
impl Copy for crate::std::integer::i128 {}
impl Copy for crate::std::integer::isize {}

impl Copy for crate::std::float::f32 {}
impl Copy for crate::std::float::f64 {}

// ---- Arcis built-in scalar types ----

impl Copy for crate::BaseField25519 {}
impl Copy for crate::ArcisX25519Pubkey {}

// ---- Composite ----

impl Copy for () {}

impl<T: Copy, const N: usize> Copy for [T; N] {}

impl<T1: Copy> Copy for (T1,) {}
impl<T1: Copy, T2: Copy> Copy for (T1, T2) {}
impl<T1: Copy, T2: Copy, T3: Copy> Copy for (T1, T2, T3) {}
impl<T1: Copy, T2: Copy, T3: Copy, T4: Copy> Copy for (T1, T2, T3, T4) {}
impl<T1: Copy, T2: Copy, T3: Copy, T4: Copy, T5: Copy> Copy for (T1, T2, T3, T4, T5) {}
impl<T1: Copy, T2: Copy, T3: Copy, T4: Copy, T5: Copy, T6: Copy> Copy for (T1, T2, T3, T4, T5, T6) {}
impl<T1: Copy, T2: Copy, T3: Copy, T4: Copy, T5: Copy, T6: Copy, T7: Copy> Copy
    for (T1, T2, T3, T4, T5, T6, T7)
{
}
impl<T1: Copy, T2: Copy, T3: Copy, T4: Copy, T5: Copy, T6: Copy, T7: Copy, T8: Copy> Copy
    for (T1, T2, T3, T4, T5, T6, T7, T8)
{
}
impl<T1: Copy, T2: Copy, T3: Copy, T4: Copy, T5: Copy, T6: Copy, T7: Copy, T8: Copy, T9: Copy> Copy
    for (T1, T2, T3, T4, T5, T6, T7, T8, T9)
{
}
impl<
        T1: Copy,
        T2: Copy,
        T3: Copy,
        T4: Copy,
        T5: Copy,
        T6: Copy,
        T7: Copy,
        T8: Copy,
        T9: Copy,
        T10: Copy,
    > Copy for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
{
}
impl<
        T1: Copy,
        T2: Copy,
        T3: Copy,
        T4: Copy,
        T5: Copy,
        T6: Copy,
        T7: Copy,
        T8: Copy,
        T9: Copy,
        T10: Copy,
        T11: Copy,
    > Copy for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
{
}
impl<
        T1: Copy,
        T2: Copy,
        T3: Copy,
        T4: Copy,
        T5: Copy,
        T6: Copy,
        T7: Copy,
        T8: Copy,
        T9: Copy,
        T10: Copy,
        T11: Copy,
        T12: Copy,
    > Copy for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
{
}

// ---- References ----
//
// `&T` is always `Copy` regardless of `T`. `&mut T` is never `Copy`.

impl<T: ?Sized> Copy for &T {}

// ---- Wrappers ----

impl<T: Copy> Copy for crate::std::option::Option<T> {}

// ---- Ranges ----
//
// Only `RangeFull` is `Copy`, matching std — the bounded range types are
// intentionally not `Copy` so that iteration cannot silently duplicate an
// iterator (advancing one copy wouldn't advance the other).

impl Copy for crate::std::ops::RangeFull {}