QuantumKeyDistribution

Struct QuantumKeyDistribution 

Source
pub struct QuantumKeyDistribution {
    pub protocol: ProtocolType,
    pub num_qubits: usize,
    pub alice: Party,
    pub bob: Party,
    pub error_rate: f64,
    pub security_bits: usize,
}
Expand description

Quantum key distribution protocol

Fields§

§protocol: ProtocolType

Type of QKD protocol

§num_qubits: usize

Number of qubits to use in the protocol

§alice: Party

Alice party

§bob: Party

Bob party

§error_rate: f64

Error rate for the quantum channel

§security_bits: usize

Security parameter (number of bits to use for security checks)

Implementations§

Source§

impl QuantumKeyDistribution

Source

pub fn new(protocol: ProtocolType, num_qubits: usize) -> Self

Creates a new QKD protocol instance

Examples found in repository?
examples/quantum_crypto.rs (line 34)
27fn run_bb84_example() -> Result<()> {
28    println!("\nBB84 Quantum Key Distribution");
29    println!("----------------------------");
30
31    // Create BB84 QKD with 1000 qubits
32    let num_qubits = 1000;
33    println!("Creating BB84 protocol with {} qubits", num_qubits);
34    let mut qkd = QuantumKeyDistribution::new(ProtocolType::BB84, num_qubits);
35
36    // Optional: set error rate
37    qkd = qkd.with_error_rate(0.03);
38    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
39
40    // Distribute key
41    println!("Performing quantum key distribution...");
42    let start = Instant::now();
43    let key_length = qkd.distribute_key()?;
44    println!("Key distribution completed in {:.2?}", start.elapsed());
45    println!("Final key length: {} bits", key_length);
46
47    // Verify keys match
48    println!("Verifying Alice and Bob have identical keys...");
49    if qkd.verify_keys() {
50        println!("✓ Key verification successful!");
51
52        // Display part of the key (first 8 bytes)
53        if let Some(key) = qkd.get_alice_key() {
54            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
55        }
56    } else {
57        println!("✗ Key verification failed!");
58    }
59
60    // Use the key for encryption
61    if let Some(key) = qkd.get_alice_key() {
62        let message = b"Hello, quantum world!";
63
64        println!(
65            "Encrypting message: '{}'",
66            std::str::from_utf8(message).unwrap()
67        );
68        let encrypted = quantrs2_ml::crypto::encrypt_with_qkd(message, key);
69
70        println!("Encrypted data: {:?}", &encrypted);
71
72        // Decrypt with Bob's key
73        if let Some(bob_key) = qkd.get_bob_key() {
74            let decrypted = quantrs2_ml::crypto::decrypt_with_qkd(&encrypted, bob_key);
75            println!(
76                "Decrypted message: '{}'",
77                std::str::from_utf8(&decrypted).unwrap()
78            );
79        }
80    }
81
82    Ok(())
83}
84
85fn run_e91_example() -> Result<()> {
86    println!("\nE91 Entanglement-Based Protocol");
87    println!("------------------------------");
88
89    // Create E91 QKD with 800 qubits
90    let num_qubits = 800;
91    println!("Creating E91 protocol with {} qubits", num_qubits);
92    let mut qkd = QuantumKeyDistribution::new(ProtocolType::E91, num_qubits);
93
94    // Set error rate
95    qkd = qkd.with_error_rate(0.02);
96    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
97
98    // Distribute key
99    println!("Performing quantum key distribution with entangled pairs...");
100    let start = Instant::now();
101    let key_length = qkd.distribute_key()?;
102    println!("Key distribution completed in {:.2?}", start.elapsed());
103    println!("Final key length: {} bits", key_length);
104
105    // Verify keys match
106    println!("Verifying Alice and Bob have identical keys...");
107    if qkd.verify_keys() {
108        println!("✓ Key verification successful!");
109
110        // Display part of the key
111        if let Some(key) = qkd.get_alice_key() {
112            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
113        }
114    } else {
115        println!("✗ Key verification failed!");
116    }
117
118    Ok(())
119}
Source

pub fn with_error_rate(self, error_rate: f64) -> Self

Sets the error rate for the quantum channel

Examples found in repository?
examples/quantum_crypto.rs (line 37)
27fn run_bb84_example() -> Result<()> {
28    println!("\nBB84 Quantum Key Distribution");
29    println!("----------------------------");
30
31    // Create BB84 QKD with 1000 qubits
32    let num_qubits = 1000;
33    println!("Creating BB84 protocol with {} qubits", num_qubits);
34    let mut qkd = QuantumKeyDistribution::new(ProtocolType::BB84, num_qubits);
35
36    // Optional: set error rate
37    qkd = qkd.with_error_rate(0.03);
38    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
39
40    // Distribute key
41    println!("Performing quantum key distribution...");
42    let start = Instant::now();
43    let key_length = qkd.distribute_key()?;
44    println!("Key distribution completed in {:.2?}", start.elapsed());
45    println!("Final key length: {} bits", key_length);
46
47    // Verify keys match
48    println!("Verifying Alice and Bob have identical keys...");
49    if qkd.verify_keys() {
50        println!("✓ Key verification successful!");
51
52        // Display part of the key (first 8 bytes)
53        if let Some(key) = qkd.get_alice_key() {
54            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
55        }
56    } else {
57        println!("✗ Key verification failed!");
58    }
59
60    // Use the key for encryption
61    if let Some(key) = qkd.get_alice_key() {
62        let message = b"Hello, quantum world!";
63
64        println!(
65            "Encrypting message: '{}'",
66            std::str::from_utf8(message).unwrap()
67        );
68        let encrypted = quantrs2_ml::crypto::encrypt_with_qkd(message, key);
69
70        println!("Encrypted data: {:?}", &encrypted);
71
72        // Decrypt with Bob's key
73        if let Some(bob_key) = qkd.get_bob_key() {
74            let decrypted = quantrs2_ml::crypto::decrypt_with_qkd(&encrypted, bob_key);
75            println!(
76                "Decrypted message: '{}'",
77                std::str::from_utf8(&decrypted).unwrap()
78            );
79        }
80    }
81
82    Ok(())
83}
84
85fn run_e91_example() -> Result<()> {
86    println!("\nE91 Entanglement-Based Protocol");
87    println!("------------------------------");
88
89    // Create E91 QKD with 800 qubits
90    let num_qubits = 800;
91    println!("Creating E91 protocol with {} qubits", num_qubits);
92    let mut qkd = QuantumKeyDistribution::new(ProtocolType::E91, num_qubits);
93
94    // Set error rate
95    qkd = qkd.with_error_rate(0.02);
96    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
97
98    // Distribute key
99    println!("Performing quantum key distribution with entangled pairs...");
100    let start = Instant::now();
101    let key_length = qkd.distribute_key()?;
102    println!("Key distribution completed in {:.2?}", start.elapsed());
103    println!("Final key length: {} bits", key_length);
104
105    // Verify keys match
106    println!("Verifying Alice and Bob have identical keys...");
107    if qkd.verify_keys() {
108        println!("✓ Key verification successful!");
109
110        // Display part of the key
111        if let Some(key) = qkd.get_alice_key() {
112            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
113        }
114    } else {
115        println!("✗ Key verification failed!");
116    }
117
118    Ok(())
119}
Source

pub fn with_security_bits(self, security_bits: usize) -> Self

Sets the security parameter

Source

pub fn distribute_key(&mut self) -> Result<usize>

Distributes a key using the specified QKD protocol

Examples found in repository?
examples/quantum_crypto.rs (line 43)
27fn run_bb84_example() -> Result<()> {
28    println!("\nBB84 Quantum Key Distribution");
29    println!("----------------------------");
30
31    // Create BB84 QKD with 1000 qubits
32    let num_qubits = 1000;
33    println!("Creating BB84 protocol with {} qubits", num_qubits);
34    let mut qkd = QuantumKeyDistribution::new(ProtocolType::BB84, num_qubits);
35
36    // Optional: set error rate
37    qkd = qkd.with_error_rate(0.03);
38    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
39
40    // Distribute key
41    println!("Performing quantum key distribution...");
42    let start = Instant::now();
43    let key_length = qkd.distribute_key()?;
44    println!("Key distribution completed in {:.2?}", start.elapsed());
45    println!("Final key length: {} bits", key_length);
46
47    // Verify keys match
48    println!("Verifying Alice and Bob have identical keys...");
49    if qkd.verify_keys() {
50        println!("✓ Key verification successful!");
51
52        // Display part of the key (first 8 bytes)
53        if let Some(key) = qkd.get_alice_key() {
54            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
55        }
56    } else {
57        println!("✗ Key verification failed!");
58    }
59
60    // Use the key for encryption
61    if let Some(key) = qkd.get_alice_key() {
62        let message = b"Hello, quantum world!";
63
64        println!(
65            "Encrypting message: '{}'",
66            std::str::from_utf8(message).unwrap()
67        );
68        let encrypted = quantrs2_ml::crypto::encrypt_with_qkd(message, key);
69
70        println!("Encrypted data: {:?}", &encrypted);
71
72        // Decrypt with Bob's key
73        if let Some(bob_key) = qkd.get_bob_key() {
74            let decrypted = quantrs2_ml::crypto::decrypt_with_qkd(&encrypted, bob_key);
75            println!(
76                "Decrypted message: '{}'",
77                std::str::from_utf8(&decrypted).unwrap()
78            );
79        }
80    }
81
82    Ok(())
83}
84
85fn run_e91_example() -> Result<()> {
86    println!("\nE91 Entanglement-Based Protocol");
87    println!("------------------------------");
88
89    // Create E91 QKD with 800 qubits
90    let num_qubits = 800;
91    println!("Creating E91 protocol with {} qubits", num_qubits);
92    let mut qkd = QuantumKeyDistribution::new(ProtocolType::E91, num_qubits);
93
94    // Set error rate
95    qkd = qkd.with_error_rate(0.02);
96    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
97
98    // Distribute key
99    println!("Performing quantum key distribution with entangled pairs...");
100    let start = Instant::now();
101    let key_length = qkd.distribute_key()?;
102    println!("Key distribution completed in {:.2?}", start.elapsed());
103    println!("Final key length: {} bits", key_length);
104
105    // Verify keys match
106    println!("Verifying Alice and Bob have identical keys...");
107    if qkd.verify_keys() {
108        println!("✓ Key verification successful!");
109
110        // Display part of the key
111        if let Some(key) = qkd.get_alice_key() {
112            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
113        }
114    } else {
115        println!("✗ Key verification failed!");
116    }
117
118    Ok(())
119}
Source

pub fn verify_keys(&self) -> bool

Verifies that Alice and Bob have identical keys

Examples found in repository?
examples/quantum_crypto.rs (line 49)
27fn run_bb84_example() -> Result<()> {
28    println!("\nBB84 Quantum Key Distribution");
29    println!("----------------------------");
30
31    // Create BB84 QKD with 1000 qubits
32    let num_qubits = 1000;
33    println!("Creating BB84 protocol with {} qubits", num_qubits);
34    let mut qkd = QuantumKeyDistribution::new(ProtocolType::BB84, num_qubits);
35
36    // Optional: set error rate
37    qkd = qkd.with_error_rate(0.03);
38    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
39
40    // Distribute key
41    println!("Performing quantum key distribution...");
42    let start = Instant::now();
43    let key_length = qkd.distribute_key()?;
44    println!("Key distribution completed in {:.2?}", start.elapsed());
45    println!("Final key length: {} bits", key_length);
46
47    // Verify keys match
48    println!("Verifying Alice and Bob have identical keys...");
49    if qkd.verify_keys() {
50        println!("✓ Key verification successful!");
51
52        // Display part of the key (first 8 bytes)
53        if let Some(key) = qkd.get_alice_key() {
54            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
55        }
56    } else {
57        println!("✗ Key verification failed!");
58    }
59
60    // Use the key for encryption
61    if let Some(key) = qkd.get_alice_key() {
62        let message = b"Hello, quantum world!";
63
64        println!(
65            "Encrypting message: '{}'",
66            std::str::from_utf8(message).unwrap()
67        );
68        let encrypted = quantrs2_ml::crypto::encrypt_with_qkd(message, key);
69
70        println!("Encrypted data: {:?}", &encrypted);
71
72        // Decrypt with Bob's key
73        if let Some(bob_key) = qkd.get_bob_key() {
74            let decrypted = quantrs2_ml::crypto::decrypt_with_qkd(&encrypted, bob_key);
75            println!(
76                "Decrypted message: '{}'",
77                std::str::from_utf8(&decrypted).unwrap()
78            );
79        }
80    }
81
82    Ok(())
83}
84
85fn run_e91_example() -> Result<()> {
86    println!("\nE91 Entanglement-Based Protocol");
87    println!("------------------------------");
88
89    // Create E91 QKD with 800 qubits
90    let num_qubits = 800;
91    println!("Creating E91 protocol with {} qubits", num_qubits);
92    let mut qkd = QuantumKeyDistribution::new(ProtocolType::E91, num_qubits);
93
94    // Set error rate
95    qkd = qkd.with_error_rate(0.02);
96    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
97
98    // Distribute key
99    println!("Performing quantum key distribution with entangled pairs...");
100    let start = Instant::now();
101    let key_length = qkd.distribute_key()?;
102    println!("Key distribution completed in {:.2?}", start.elapsed());
103    println!("Final key length: {} bits", key_length);
104
105    // Verify keys match
106    println!("Verifying Alice and Bob have identical keys...");
107    if qkd.verify_keys() {
108        println!("✓ Key verification successful!");
109
110        // Display part of the key
111        if let Some(key) = qkd.get_alice_key() {
112            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
113        }
114    } else {
115        println!("✗ Key verification failed!");
116    }
117
118    Ok(())
119}
Source

pub fn get_alice_key(&self) -> Option<Vec<u8>>

Gets Alice’s key (if generated)

Examples found in repository?
examples/quantum_crypto.rs (line 53)
27fn run_bb84_example() -> Result<()> {
28    println!("\nBB84 Quantum Key Distribution");
29    println!("----------------------------");
30
31    // Create BB84 QKD with 1000 qubits
32    let num_qubits = 1000;
33    println!("Creating BB84 protocol with {} qubits", num_qubits);
34    let mut qkd = QuantumKeyDistribution::new(ProtocolType::BB84, num_qubits);
35
36    // Optional: set error rate
37    qkd = qkd.with_error_rate(0.03);
38    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
39
40    // Distribute key
41    println!("Performing quantum key distribution...");
42    let start = Instant::now();
43    let key_length = qkd.distribute_key()?;
44    println!("Key distribution completed in {:.2?}", start.elapsed());
45    println!("Final key length: {} bits", key_length);
46
47    // Verify keys match
48    println!("Verifying Alice and Bob have identical keys...");
49    if qkd.verify_keys() {
50        println!("✓ Key verification successful!");
51
52        // Display part of the key (first 8 bytes)
53        if let Some(key) = qkd.get_alice_key() {
54            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
55        }
56    } else {
57        println!("✗ Key verification failed!");
58    }
59
60    // Use the key for encryption
61    if let Some(key) = qkd.get_alice_key() {
62        let message = b"Hello, quantum world!";
63
64        println!(
65            "Encrypting message: '{}'",
66            std::str::from_utf8(message).unwrap()
67        );
68        let encrypted = quantrs2_ml::crypto::encrypt_with_qkd(message, key);
69
70        println!("Encrypted data: {:?}", &encrypted);
71
72        // Decrypt with Bob's key
73        if let Some(bob_key) = qkd.get_bob_key() {
74            let decrypted = quantrs2_ml::crypto::decrypt_with_qkd(&encrypted, bob_key);
75            println!(
76                "Decrypted message: '{}'",
77                std::str::from_utf8(&decrypted).unwrap()
78            );
79        }
80    }
81
82    Ok(())
83}
84
85fn run_e91_example() -> Result<()> {
86    println!("\nE91 Entanglement-Based Protocol");
87    println!("------------------------------");
88
89    // Create E91 QKD with 800 qubits
90    let num_qubits = 800;
91    println!("Creating E91 protocol with {} qubits", num_qubits);
92    let mut qkd = QuantumKeyDistribution::new(ProtocolType::E91, num_qubits);
93
94    // Set error rate
95    qkd = qkd.with_error_rate(0.02);
96    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
97
98    // Distribute key
99    println!("Performing quantum key distribution with entangled pairs...");
100    let start = Instant::now();
101    let key_length = qkd.distribute_key()?;
102    println!("Key distribution completed in {:.2?}", start.elapsed());
103    println!("Final key length: {} bits", key_length);
104
105    // Verify keys match
106    println!("Verifying Alice and Bob have identical keys...");
107    if qkd.verify_keys() {
108        println!("✓ Key verification successful!");
109
110        // Display part of the key
111        if let Some(key) = qkd.get_alice_key() {
112            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
113        }
114    } else {
115        println!("✗ Key verification failed!");
116    }
117
118    Ok(())
119}
Source

pub fn get_bob_key(&self) -> Option<Vec<u8>>

Gets Bob’s key (if generated)

Examples found in repository?
examples/quantum_crypto.rs (line 73)
27fn run_bb84_example() -> Result<()> {
28    println!("\nBB84 Quantum Key Distribution");
29    println!("----------------------------");
30
31    // Create BB84 QKD with 1000 qubits
32    let num_qubits = 1000;
33    println!("Creating BB84 protocol with {} qubits", num_qubits);
34    let mut qkd = QuantumKeyDistribution::new(ProtocolType::BB84, num_qubits);
35
36    // Optional: set error rate
37    qkd = qkd.with_error_rate(0.03);
38    println!("Simulated error rate: {:.1}%", qkd.error_rate * 100.0);
39
40    // Distribute key
41    println!("Performing quantum key distribution...");
42    let start = Instant::now();
43    let key_length = qkd.distribute_key()?;
44    println!("Key distribution completed in {:.2?}", start.elapsed());
45    println!("Final key length: {} bits", key_length);
46
47    // Verify keys match
48    println!("Verifying Alice and Bob have identical keys...");
49    if qkd.verify_keys() {
50        println!("✓ Key verification successful!");
51
52        // Display part of the key (first 8 bytes)
53        if let Some(key) = qkd.get_alice_key() {
54            println!("First 8 bytes of key: {:?}", &key[0..8.min(key.len())]);
55        }
56    } else {
57        println!("✗ Key verification failed!");
58    }
59
60    // Use the key for encryption
61    if let Some(key) = qkd.get_alice_key() {
62        let message = b"Hello, quantum world!";
63
64        println!(
65            "Encrypting message: '{}'",
66            std::str::from_utf8(message).unwrap()
67        );
68        let encrypted = quantrs2_ml::crypto::encrypt_with_qkd(message, key);
69
70        println!("Encrypted data: {:?}", &encrypted);
71
72        // Decrypt with Bob's key
73        if let Some(bob_key) = qkd.get_bob_key() {
74            let decrypted = quantrs2_ml::crypto::decrypt_with_qkd(&encrypted, bob_key);
75            println!(
76                "Decrypted message: '{}'",
77                std::str::from_utf8(&decrypted).unwrap()
78            );
79        }
80    }
81
82    Ok(())
83}

Trait Implementations§

Source§

impl Clone for QuantumKeyDistribution

Source§

fn clone(&self) -> QuantumKeyDistribution

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QuantumKeyDistribution

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Ungil for T
where T: Send,