LweCiphertextVectorMutView64

Struct LweCiphertextVectorMutView64 

Source
pub struct LweCiphertextVectorMutView64<'a>(/* private fields */);
Expand description

A structure representing a vector of LWE ciphertext views, with 64 bits of precision.

By view here, we mean that the entity does not own the data, but mutably borrows it.

§Notes:

This view is not Clone as Clone for a slice is not defined. It is not Deserialize either, as Deserialize of a slice is not defined. Mutable variant.

Trait Implementations§

Source§

impl AbstractEntity for LweCiphertextVectorMutView64<'_>

Source§

type Kind = LweCiphertextVectorKind

The kind of the entity.
Source§

impl<'a> Debug for LweCiphertextVectorMutView64<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b> EntitySerializationEngine<LweCiphertextVectorMutView64<'b>, Vec<u8>> for DefaultSerializationEngine

§Description:

Implementation of EntitySerializationEngine for DefaultSerializationEngine that operates on 64 bits integers. It serializes a LWE ciphertext vector view entity. Mutable variant.

Source§

fn serialize( &mut self, entity: &LweCiphertextVectorMutView64<'b>, ) -> Result<Vec<u8>, EntitySerializationError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, Variance, *};

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(6);
let lwe_count = LweCiphertextCount(3);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = vec![3_u64 << 50; lwe_count.0];
let noise = Variance(2_f64.powf(-50.));

// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let key: LweSecretKey64 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector64 = engine.create_plaintext_vector_from(&input)?;

let mut ciphertext_vector: LweCiphertextVector64 =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
let mut raw_buffer = engine.consume_retrieve_lwe_ciphertext_vector(ciphertext_vector)?;
let view: LweCiphertextVectorMutView64 = engine.create_lwe_ciphertext_vector_from(
    raw_buffer.as_mut_slice(),
    lwe_dimension.to_lwe_size(),
)?;

let mut serialization_engine = DefaultSerializationEngine::new(())?;
let serialized = serialization_engine.serialize(&view)?;
let recovered: LweCiphertextVector64 =
    serialization_engine.deserialize(serialized.as_slice())?;
let recovered_buffer = engine.consume_retrieve_lwe_ciphertext_vector(recovered)?;
assert_eq!(raw_buffer, recovered_buffer);
Source§

unsafe fn serialize_unchecked( &mut self, entity: &LweCiphertextVectorMutView64<'b>, ) -> Vec<u8>

Unsafely serializes an entity. Read more
Source§

impl LweCiphertextDiscardingBitExtractEngine<FftFourierLweBootstrapKey64, LweKeyswitchKey64, LweCiphertextView64<'_>, LweCiphertextVectorMutView64<'_>> for FftEngine

§Description:

Implementation of LweCiphertextDiscardingBitExtractEngine for FftEngine that operates on views containing 64 bits integers.

Source§

fn discard_extract_bits_lwe_ciphertext( &mut self, output: &mut LweCiphertextVectorMutView64<'_>, input: &LweCiphertextView64<'_>, bsk: &FftFourierLweBootstrapKey64, ksk: &LweKeyswitchKey64, extracted_bits_count: ExtractedBitsCount, delta_log: DeltaLog, ) -> Result<(), LweCiphertextDiscardingBitExtractError<Self::EngineError>>

§Example
use concrete_core::prelude::{
    DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
    Variance, *,
};

// Here a hard-set encoding is applied (shift by 20 bits)
let input = 3_u64 << 20;
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(1), PolynomialSize(512));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let extracted_bits_count = ExtractedBitsCount(1);
let delta_log = DeltaLog(5);
let noise = Variance(2_f64.powf(-50.));
let large_lwe_dim = LweDimension(glwe_dim.0 * poly_size.0);

// Unix seeder must be given a secret input.
// Here we just give it 0, and rely on /dev/random only for tests.
const UNSAFE_SECRET: u128 = 0;
let mut default_engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let mut fft_engine = FftEngine::new(())?;
let glwe_sk: GlweSecretKey64 =
    default_engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let input_lwe_sk: LweSecretKey64 =
    default_engine.transform_glwe_secret_key_to_lwe_secret_key(glwe_sk.clone())?;
let output_lwe_sk: LweSecretKey64 = default_engine.generate_new_lwe_secret_key(lwe_dim)?;
let bsk: LweBootstrapKey64 = default_engine.generate_new_lwe_bootstrap_key(
    &output_lwe_sk,
    &glwe_sk,
    dec_bl,
    dec_lc,
    noise,
)?;
let ksk: LweKeyswitchKey64 = default_engine.generate_new_lwe_keyswitch_key(
    &input_lwe_sk,
    &output_lwe_sk,
    dec_lc,
    dec_bl,
    noise,
)?;
let bsk: FftFourierLweBootstrapKey64 = fft_engine.convert_lwe_bootstrap_key(&bsk)?;
let plaintext = default_engine.create_plaintext_from(&input)?;

let mut input_ct_container = vec![0u64; input_lwe_sk.lwe_dimension().to_lwe_size().0];
let mut input: LweCiphertextMutView64 =
    default_engine.create_lwe_ciphertext_from(input_ct_container.as_mut_slice())?;

let mut output_ct_vec_container =
    vec![0u64; output_lwe_sk.lwe_dimension().to_lwe_size().0 * extracted_bits_count.0];
let mut output: LweCiphertextVectorMutView64 = default_engine
    .create_lwe_ciphertext_vector_from(
        output_ct_vec_container.as_mut_slice(),
        output_lwe_sk.lwe_dimension().to_lwe_size(),
    )?;

default_engine.discard_encrypt_lwe_ciphertext(&input_lwe_sk, &mut input, &plaintext, noise)?;

let input_slice = default_engine.consume_retrieve_lwe_ciphertext(input)?;
let input: LweCiphertextView64 = default_engine.create_lwe_ciphertext_from(&input_slice[..])?;

fft_engine.discard_extract_bits_lwe_ciphertext(
    &mut output,
    &input,
    &bsk,
    &ksk,
    extracted_bits_count,
    delta_log,
)?;
assert_eq!(output.lwe_dimension(), lwe_dim);
assert_eq!(
    output.lwe_ciphertext_count(),
    LweCiphertextCount(extracted_bits_count.0)
);
Source§

unsafe fn discard_extract_bits_lwe_ciphertext_unchecked( &mut self, output: &mut LweCiphertextVectorMutView64<'_>, input: &LweCiphertextView64<'_>, bsk: &FftFourierLweBootstrapKey64, ksk: &LweKeyswitchKey64, extracted_bits_count: ExtractedBitsCount, delta_log: DeltaLog, )

Unsafely extract bits of an LWE ciphertext. Read more
Source§

impl<'data> LweCiphertextVectorConsumingRetrievalEngine<LweCiphertextVectorMutView64<'data>, &'data mut [u64]> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorConsumingRetrievalEngine for DefaultEngine that returns the underlying slice of a LweCiphertextVectorMutView64 consuming it in the process

Source§

fn consume_retrieve_lwe_ciphertext_vector( &mut self, ciphertext: LweCiphertextVectorMutView64<'data>, ) -> Result<&'data mut [u64], LweCiphertextVectorConsumingRetrievalError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweSize, *};

// Here we create a container outside of the engine
// Note that the size here is just for demonstration purposes and should not be chosen
// without proper security analysis for production
let lwe_size = LweSize(16);
let lwe_ciphertext_count = LweCiphertextCount(8);
let mut owned_container = vec![0_u64; lwe_size.0 * lwe_ciphertext_count.0];

let slice = &mut owned_container[..];
// Required as we can't borrow a mut slice more than once
let underlying_ptr = slice.as_ptr();

// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let ciphertext_vector_view: LweCiphertextVectorMutView64 =
    engine.create_lwe_ciphertext_vector_from(slice, lwe_size)?;
let retrieved_slice = engine.consume_retrieve_lwe_ciphertext_vector(ciphertext_vector_view)?;
assert_eq!(underlying_ptr, retrieved_slice.as_ptr());
Source§

unsafe fn consume_retrieve_lwe_ciphertext_vector_unchecked( &mut self, ciphertext: LweCiphertextVectorMutView64<'data>, ) -> &'data mut [u64]

Unsafely retrieves the content of the container from an LWE ciphertext vector, consuming it in the process. Read more
Source§

impl<'data> LweCiphertextVectorCreationEngine<&'data mut [u64], LweCiphertextVectorMutView64<'data>> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorCreationEngine for DefaultEngine which returns a mutable LweCiphertextVectorMutView64 that does not own its memory.

Source§

fn create_lwe_ciphertext_vector_from( &mut self, container: &'data mut [u64], lwe_size: LweSize, ) -> Result<LweCiphertextVectorMutView64<'data>, LweCiphertextVectorCreationError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweSize, *};

// Here we create a container outside of the engine
// Note that the size here is just for demonstration purposes and should not be chosen
// without proper security analysis for production
let lwe_size = LweSize(16);
let lwe_count = LweCiphertextCount(3);
let mut owned_container = vec![0_u64; lwe_size.0 * lwe_count.0];

let slice = &mut owned_container[..];

// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let ciphertext_vector_view: LweCiphertextVectorMutView64 =
    engine.create_lwe_ciphertext_vector_from(slice, lwe_size)?;
Source§

unsafe fn create_lwe_ciphertext_vector_from_unchecked( &mut self, container: &'data mut [u64], lwe_size: LweSize, ) -> LweCiphertextVectorMutView64<'data>

Unsafely creates an LWE ciphertext vector from an arbitrary container. Read more
Source§

impl LweCiphertextVectorDiscardingCircuitBootstrapBooleanVerticalPackingEngine<LweCiphertextVectorView64<'_>, LweCiphertextVectorMutView64<'_>, FftFourierLweBootstrapKey64, PlaintextVector64, LweCircuitBootstrapPrivateFunctionalPackingKeyswitchKeys64> for FftEngine

Source§

fn discard_circuit_bootstrap_boolean_vertical_packing_lwe_ciphertext_vector( &mut self, output: &mut LweCiphertextVectorMutView64<'_>, input: &LweCiphertextVectorView64<'_>, bsk: &FftFourierLweBootstrapKey64, luts: &PlaintextVector64, cbs_level_count: DecompositionLevelCount, cbs_base_log: DecompositionBaseLog, cbs_pfpksk: &LweCircuitBootstrapPrivateFunctionalPackingKeyswitchKeys64, ) -> Result<(), LweCiphertextVectorDiscardingCircuitBootstrapBooleanVerticalPackingError<Self::EngineError>>

§Example:
use concrete_core::prelude::*;
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let polynomial_size = PolynomialSize(1024);
let glwe_dimension = GlweDimension(1);
let lwe_dimension = LweDimension(481);

let var_small = Variance::from_variance(2f64.powf(-80.0));
let var_big = Variance::from_variance(2f64.powf(-70.0));

const UNSAFE_SECRET: u128 = 0;
let mut default_engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let mut default_parallel_engine =
    DefaultParallelEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let mut fft_engine = FftEngine::new(())?;

let glwe_sk: GlweSecretKey64 =
    default_engine.generate_new_glwe_secret_key(glwe_dimension, polynomial_size)?;
let lwe_small_sk: LweSecretKey64 = default_engine.generate_new_lwe_secret_key(lwe_dimension)?;
let lwe_big_sk: LweSecretKey64 =
    default_engine.transform_glwe_secret_key_to_lwe_secret_key(glwe_sk.clone())?;

let bsk_level_count = DecompositionLevelCount(9);
let bsk_base_log = DecompositionBaseLog(4);

let std_bsk: LweBootstrapKey64 = default_parallel_engine.generate_new_lwe_bootstrap_key(
    &lwe_small_sk,
    &glwe_sk,
    bsk_base_log,
    bsk_level_count,
    var_small,
)?;

let fourier_bsk: FftFourierLweBootstrapKey64 =
    fft_engine.convert_lwe_bootstrap_key(&std_bsk)?;

let ksk_level_count = DecompositionLevelCount(9);
let ksk_base_log = DecompositionBaseLog(1);

let ksk_big_to_small: LweKeyswitchKey64 = default_engine.generate_new_lwe_keyswitch_key(
    &lwe_big_sk,
    &lwe_small_sk,
    ksk_level_count,
    ksk_base_log,
    var_big,
)?;

let pfpksk_level_count = DecompositionLevelCount(9);
let pfpksk_base_log = DecompositionBaseLog(4);

let cbs_pfpksk: LweCircuitBootstrapPrivateFunctionalPackingKeyswitchKeys64 = default_engine
    .generate_new_lwe_circuit_bootstrap_private_functional_packing_keyswitch_keys(
        &lwe_big_sk,
        &glwe_sk,
        pfpksk_base_log,
        pfpksk_level_count,
        var_small,
    )?;

// We will have a message with 10 bits of information
let message_bits = 10;
let bits_to_extract = ExtractedBitsCount(message_bits);

// The value we encrypt is 42, we will extract the bits of this value and apply the
// circuit bootstrapping followed by the vertical packing on the extracted bits.
let cleartext = 42;
let delta_log_msg = DeltaLog(64 - message_bits);

let encoded_message = default_engine.create_plaintext_from(&(cleartext << delta_log_msg.0))?;
let lwe_in = default_engine.encrypt_lwe_ciphertext(&lwe_big_sk, &encoded_message, var_big)?;

// Bit extraction output, use the zero_encrypt engine to allocate a ciphertext vector
let mut bit_extraction_output = default_engine.zero_encrypt_lwe_ciphertext_vector(
    &lwe_small_sk,
    var_small,
    LweCiphertextCount(bits_to_extract.0),
)?;

fft_engine.discard_extract_bits_lwe_ciphertext(
    &mut bit_extraction_output,
    &lwe_in,
    &fourier_bsk,
    &ksk_big_to_small,
    bits_to_extract,
    delta_log_msg,
)?;

// Though the delta log here is the same as the message delta log, in the general case they
// are different, so we create two DeltaLog parameters
let delta_log_lut = DeltaLog(64 - message_bits);

// Create a look-up table we want to apply during vertical packing, here just the identity
// with the proper encoding.
// Note that this particular table will not trigger the cmux tree from the vertical packing,
// adapt the LUT generation to your usage.
// Here we apply a single look-up table as we output a single ciphertext.
let number_of_luts_and_output_vp_ciphertexts = 1;
let lut_size = 1 << bits_to_extract.0;
let mut lut: Vec<u64> = Vec::with_capacity(lut_size);

for i in 0..lut_size {
    lut.push((i as u64 % (1 << message_bits)) << delta_log_lut.0);
}

let lut_as_plaintext_vector = default_engine.create_plaintext_vector_from(lut.as_slice())?;

// We run on views, so we need a container for the output
let mut output_cbs_vp_ct_container = vec![
    0u64;
    lwe_big_sk.lwe_dimension().to_lwe_size().0
        * number_of_luts_and_output_vp_ciphertexts
];

let mut output_cbs_vp_ct_mut_view: LweCiphertextVectorMutView64 = default_engine
    .create_lwe_ciphertext_vector_from(
        output_cbs_vp_ct_container.as_mut_slice(),
        lwe_big_sk.lwe_dimension().to_lwe_size(),
    )?;
// And we need to get a view on the bits extracted earlier that serve as inputs to the
// circuit bootstrap + vertical packing
let extracted_bits_lwe_size = bit_extraction_output.lwe_dimension().to_lwe_size();
let extracted_bits_container =
    default_engine.consume_retrieve_lwe_ciphertext_vector(bit_extraction_output)?;
let cbs_vp_input_vector_view: LweCiphertextVectorView64 = default_engine
    .create_lwe_ciphertext_vector_from(
        extracted_bits_container.as_slice(),
        extracted_bits_lwe_size,
    )?;

let cbs_level_count = DecompositionLevelCount(4);
let cbs_base_log = DecompositionBaseLog(6);

fft_engine.discard_circuit_bootstrap_boolean_vertical_packing_lwe_ciphertext_vector(
    &mut output_cbs_vp_ct_mut_view,
    &cbs_vp_input_vector_view,
    &fourier_bsk,
    &lut_as_plaintext_vector,
    cbs_level_count,
    cbs_base_log,
    &cbs_pfpksk,
)?;

assert_eq!(output_cbs_vp_ct_mut_view.lwe_ciphertext_count().0, 1);
assert_eq!(
    output_cbs_vp_ct_mut_view.lwe_dimension(),
    LweDimension(glwe_dimension.0 * polynomial_size.0)
);
Source§

unsafe fn discard_circuit_bootstrap_boolean_vertical_packing_lwe_ciphertext_vector_unchecked( &mut self, output: &mut LweCiphertextVectorMutView64<'_>, input: &LweCiphertextVectorView64<'_>, bsk: &FftFourierLweBootstrapKey64, luts: &PlaintextVector64, cbs_level_count: DecompositionLevelCount, cbs_base_log: DecompositionBaseLog, cbs_pfpksk: &LweCircuitBootstrapPrivateFunctionalPackingKeyswitchKeys64, )

Unsafely performs the circuit bootstrapping on all boolean input LWE ciphertexts followed by vertical packing using the provided look-up table. Read more
Source§

impl LweCiphertextVectorDiscardingEncryptionEngine<LweSecretKey64, PlaintextVector64, LweCiphertextVectorMutView64<'_>> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDiscardingEncryptionEngine for DefaultEngine that operates on 64 bits integers.

Source§

fn discard_encrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey64, output: &mut LweCiphertextVectorMutView64<'_>, input: &PlaintextVector64, noise: Variance, ) -> Result<(), LweCiphertextVectorDiscardingEncryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(6);
let lwe_count = LweCiphertextCount(3);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = vec![3_u64 << 50; lwe_count.0];
let noise = Variance(2_f64.powf(-50.));

// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let key: LweSecretKey64 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector64 = engine.create_plaintext_vector_from(&input)?;

let mut output_ciphertext_vector_container = vec![0_64; lwe_dimension.to_lwe_size().0 *
    lwe_count.0];
let mut ciphertext_vector: LweCiphertextVectorMutView64 =
    engine.create_lwe_ciphertext_vector_from(&mut output_ciphertext_vector_container[..],
    lwe_dimension.to_lwe_size())?;

engine.discard_encrypt_lwe_ciphertext_vector(&key, &mut ciphertext_vector,
    &plaintext_vector, noise)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
assert_eq!(
Source§

unsafe fn discard_encrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey64, output: &mut LweCiphertextVectorMutView64<'_>, input: &PlaintextVector64, noise: Variance, )

Unsafely encryprs an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorEntity for LweCiphertextVectorMutView64<'_>

Source§

fn lwe_dimension(&self) -> LweDimension

Returns the LWE dimension of the ciphertexts.
Source§

fn lwe_ciphertext_count(&self) -> LweCiphertextCount

Returns the number of ciphertexts contained in the vector.
Source§

impl<'a> PartialEq for LweCiphertextVectorMutView64<'a>

Source§

fn eq(&self, other: &LweCiphertextVectorMutView64<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for LweCiphertextVectorMutView64<'a>

Source§

impl<'a> StructuralPartialEq for LweCiphertextVectorMutView64<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.