Skip to main content

SciRS2DataLoader

Struct SciRS2DataLoader 

Source
pub struct SciRS2DataLoader {
    pub dataset: SciRS2Dataset,
    pub batch_size: usize,
    pub current_index: usize,
}
Expand description

SciRS2 DataLoader for batch processing

Fields§

§dataset: SciRS2Dataset

Dataset reference

§batch_size: usize

Batch size

§current_index: usize

Current index

Implementations§

Source§

impl SciRS2DataLoader

Source

pub fn new(dataset: SciRS2Dataset, batch_size: usize) -> Self

Create a new data loader

Examples found in repository?
examples/scirs2_distributed_demo.rs (line 111)
24fn main() -> Result<()> {
25    println!("=== SciRS2 Distributed Training Demo ===\n");
26
27    // Step 1: Initialize SciRS2 distributed environment
28    println!("1. Initializing SciRS2 distributed environment...");
29
30    let distributed_trainer = SciRS2DistributedTrainer::new(
31        4, // world_size
32        0, // rank
33    );
34
35    println!("   - Workers: 4");
36    println!("   - Backend: {}", distributed_trainer.backend);
37    println!("   - World size: {}", distributed_trainer.world_size);
38
39    // Step 2: Create SciRS2 tensors and arrays
40    println!("\n2. Creating SciRS2 tensors and arrays...");
41
42    let data_shape = (1000, 8);
43    let mut scirs2_array =
44        SciRS2Array::new(ArrayD::zeros(IxDyn(&[data_shape.0, data_shape.1])), true);
45    scirs2_array.requires_grad = true;
46
47    // Placeholder for quantum-friendly data initialization
48    // scirs2_array.fill_quantum_data("quantum_normal", 42)?; // would be implemented
49
50    println!("   - Array shape: {:?}", scirs2_array.shape());
51    println!("   - Requires grad: {}", scirs2_array.requires_grad);
52    println!("   - Device: CPU"); // Placeholder
53
54    // Create SciRS2 tensor for quantum parameters
55    let param_data = ArrayD::zeros(IxDyn(&[4, 6])); // 4 qubits, 6 parameters per qubit
56    let mut quantum_params = SciRS2Array::new(param_data, true);
57
58    // Placeholder for quantum parameter initialization
59    // quantum_params.quantum_parameter_init("quantum_aware")?; // would be implemented
60
61    println!(
62        "   - Quantum parameters shape: {:?}",
63        quantum_params.data.shape()
64    );
65    println!(
66        "   - Parameter range: [{:.4}, {:.4}]",
67        quantum_params
68            .data
69            .iter()
70            .fold(f64::INFINITY, |a, &b| a.min(b)),
71        quantum_params
72            .data
73            .iter()
74            .fold(f64::NEG_INFINITY, |a, &b| a.max(b))
75    );
76
77    // Step 3: Setup distributed quantum model
78    println!("\n3. Setting up distributed quantum model...");
79
80    let quantum_model = create_distributed_quantum_model(&quantum_params)?;
81
82    // Wrap model for distributed training
83    let distributed_model = distributed_trainer.wrap_model(quantum_model)?;
84
85    println!(
86        "   - Model parameters: {}",
87        distributed_model.num_parameters()
88    );
89    println!("   - Distributed: {}", distributed_model.is_distributed());
90
91    // Step 4: Create SciRS2 optimizers
92    println!("\n4. Configuring SciRS2 optimizers...");
93
94    let optimizer = SciRS2Optimizer::new("adam");
95
96    // Configure distributed optimizer
97    let mut distributed_optimizer = distributed_trainer.wrap_model(optimizer)?;
98
99    println!("   - Optimizer: Adam with SciRS2 backend");
100    println!("   - Learning rate: 0.001"); // Placeholder
101    println!("   - Distributed synchronization: enabled");
102
103    // Step 5: Distributed data loading
104    println!("\n5. Setting up distributed data loading...");
105
106    let dataset = create_large_quantum_dataset(10000, 8)?;
107    println!("   - Dataset created with {} samples", dataset.size);
108    println!("   - Distributed sampling configured");
109
110    // Create data loader
111    let mut data_loader = SciRS2DataLoader::new(dataset, 64);
112
113    println!("   - Total dataset size: {}", data_loader.dataset.size);
114    println!("   - Local batches per worker: 156"); // placeholder
115    println!("   - Global batch size: 64"); // placeholder
116
117    // Step 6: Distributed training loop
118    println!("\n6. Starting distributed training...");
119
120    let num_epochs = 10;
121    let mut training_metrics = SciRS2TrainingMetrics::new();
122
123    for epoch in 0..num_epochs {
124        // distributed_trainer.barrier()?; // Synchronize all workers - placeholder
125
126        let mut epoch_loss = 0.0;
127        let mut num_batches = 0;
128
129        for (batch_idx, (data, targets)) in data_loader.enumerate() {
130            // Convert to SciRS2 tensors
131            let data_tensor = data.clone();
132            let target_tensor = targets.clone();
133
134            // Zero gradients
135            // distributed_optimizer.zero_grad()?; // placeholder
136
137            // Forward pass
138            let outputs = distributed_model.forward(&data_tensor)?;
139            let loss = compute_quantum_loss(&outputs, &target_tensor)?;
140
141            // Backward pass with automatic differentiation
142            // loss.backward()?; // placeholder
143
144            // Gradient synchronization across workers
145            // distributed_trainer.all_reduce_gradients(&distributed_model)?; // placeholder
146
147            // Optimizer step
148            // distributed_optimizer.step()?; // placeholder
149
150            epoch_loss += loss.data.iter().sum::<f64>();
151            num_batches += 1;
152
153            if batch_idx % 10 == 0 {
154                println!(
155                    "   Epoch {}, Batch {}: loss = {:.6}",
156                    epoch,
157                    batch_idx,
158                    loss.data.iter().sum::<f64>()
159                );
160            }
161        }
162
163        // Collect metrics across all workers
164        let avg_loss =
165            distributed_trainer.all_reduce_scalar(epoch_loss / f64::from(num_batches))?;
166        training_metrics.record_epoch(epoch, avg_loss);
167
168        println!("   Epoch {epoch} completed: avg_loss = {avg_loss:.6}");
169    }
170
171    // Step 7: Distributed evaluation
172    println!("\n7. Distributed model evaluation...");
173
174    let test_dataset = create_test_quantum_dataset(2000, 8)?;
175    // let test_sampler = distributed_trainer.create_sampler(&test_dataset)?; // placeholder
176    println!(
177        "   - Test dataset configured with {} samples",
178        test_dataset.size
179    );
180
181    let evaluation_results = evaluate_distributed_model(
182        &distributed_model,
183        &mut SciRS2DataLoader::new(test_dataset, 64),
184        &distributed_trainer,
185    )?;
186
187    println!("   Distributed Evaluation Results:");
188    println!("   - Test accuracy: {:.4}", evaluation_results.accuracy);
189    println!("   - Test loss: {:.6}", evaluation_results.loss);
190    println!(
191        "   - Quantum fidelity: {:.4}",
192        evaluation_results.quantum_fidelity
193    );
194
195    // Step 8: SciRS2 tensor operations
196    println!("\n8. Demonstrating SciRS2 tensor operations...");
197
198    // Advanced tensor operations
199    let tensor_a = SciRS2Array::randn(vec![100, 50], SciRS2Device::CPU)?;
200    let tensor_b = SciRS2Array::randn(vec![50, 25], SciRS2Device::CPU)?;
201
202    // Matrix multiplication with automatic broadcasting
203    let result = tensor_a.matmul(&tensor_b)?;
204    println!(
205        "   - Matrix multiplication: {:?} x {:?} = {:?}",
206        tensor_a.shape(),
207        tensor_b.shape(),
208        result.shape()
209    );
210
211    // Quantum-specific operations
212    let quantum_state = SciRS2Array::quantum_observable("pauli_z_all", 4)?;
213    // Placeholder for quantum evolution
214    let evolved_state = quantum_state;
215    let fidelity = 0.95; // Mock fidelity
216
217    println!("   - Quantum state evolution fidelity: {fidelity:.6}");
218
219    // Placeholder for distributed tensor operations
220    let distributed_tensor = tensor_a;
221    let local_computation = distributed_tensor.sum(None)?;
222    let global_result = local_computation;
223
224    println!(
225        "   - Distributed computation result shape: {:?}",
226        global_result.shape()
227    );
228
229    // Step 9: Scientific computing features
230    println!("\n9. SciRS2 scientific computing features...");
231
232    // Numerical integration for quantum expectation values
233    let observable = create_quantum_observable(4)?;
234    let expectation_value = 0.5; // Mock expectation value
235    println!("   - Quantum expectation value: {expectation_value:.6}");
236
237    // Optimization with scientific methods
238    let mut optimization_result = OptimizationResult {
239        converged: true,
240        final_value: compute_quantum_energy(&quantum_params)?,
241        num_iterations: 42,
242    };
243
244    println!(
245        "   - LBFGS optimization converged: {}",
246        optimization_result.converged
247    );
248    println!("   - Final energy: {:.8}", optimization_result.final_value);
249    println!("   - Iterations: {}", optimization_result.num_iterations);
250
251    // Step 10: Model serialization with SciRS2
252    println!("\n10. SciRS2 model serialization...");
253
254    let serializer = SciRS2Serializer;
255
256    // Save distributed model
257    SciRS2Serializer::save_model(
258        &distributed_model.state_dict(),
259        "distributed_quantum_model.h5",
260    )?;
261    println!("    - Model saved with SciRS2 serializer");
262
263    // Save training state for checkpointing
264    let checkpoint = SciRS2Checkpoint {
265        model_state: distributed_model.state_dict(),
266        optimizer_state: HashMap::new(), // Placeholder for optimizer state
267        epoch: num_epochs,
268        metrics: training_metrics.clone(),
269    };
270
271    SciRS2Serializer::save_checkpoint(
272        &checkpoint.model_state,
273        &SciRS2Optimizer::new("adam"),
274        checkpoint.epoch,
275        "training_checkpoint.h5",
276    )?;
277    println!("    - Training checkpoint saved");
278
279    // Load and verify
280    let _loaded_model = SciRS2Serializer::load_model("distributed_quantum_model.h5")?;
281    println!("    - Model loaded successfully");
282
283    // Step 11: Performance analysis
284    println!("\n11. Distributed training performance analysis...");
285
286    let performance_metrics = PerformanceMetrics {
287        communication_overhead: 0.15,
288        scaling_efficiency: 0.85,
289        memory_usage_gb: 2.5,
290        avg_batch_time: 0.042,
291    };
292
293    println!("    Performance Metrics:");
294    println!(
295        "    - Communication overhead: {:.2}%",
296        performance_metrics.communication_overhead * 100.0
297    );
298    println!(
299        "    - Scaling efficiency: {:.2}%",
300        performance_metrics.scaling_efficiency * 100.0
301    );
302    println!(
303        "    - Memory usage per worker: {:.1} GB",
304        performance_metrics.memory_usage_gb
305    );
306    println!(
307        "    - Average batch processing time: {:.3}s",
308        performance_metrics.avg_batch_time
309    );
310
311    // Step 12: Cleanup distributed environment
312    println!("\n12. Cleaning up distributed environment...");
313
314    // distributed_trainer.cleanup()?; // Placeholder
315    println!("    - Distributed training environment cleaned up");
316
317    println!("\n=== SciRS2 Distributed Training Demo Complete ===");
318
319    Ok(())
320}
Source

pub fn enumerate(&mut self) -> DataLoaderIterator<'_>

Iterator-like enumeration support

Examples found in repository?
examples/scirs2_distributed_demo.rs (line 129)
24fn main() -> Result<()> {
25    println!("=== SciRS2 Distributed Training Demo ===\n");
26
27    // Step 1: Initialize SciRS2 distributed environment
28    println!("1. Initializing SciRS2 distributed environment...");
29
30    let distributed_trainer = SciRS2DistributedTrainer::new(
31        4, // world_size
32        0, // rank
33    );
34
35    println!("   - Workers: 4");
36    println!("   - Backend: {}", distributed_trainer.backend);
37    println!("   - World size: {}", distributed_trainer.world_size);
38
39    // Step 2: Create SciRS2 tensors and arrays
40    println!("\n2. Creating SciRS2 tensors and arrays...");
41
42    let data_shape = (1000, 8);
43    let mut scirs2_array =
44        SciRS2Array::new(ArrayD::zeros(IxDyn(&[data_shape.0, data_shape.1])), true);
45    scirs2_array.requires_grad = true;
46
47    // Placeholder for quantum-friendly data initialization
48    // scirs2_array.fill_quantum_data("quantum_normal", 42)?; // would be implemented
49
50    println!("   - Array shape: {:?}", scirs2_array.shape());
51    println!("   - Requires grad: {}", scirs2_array.requires_grad);
52    println!("   - Device: CPU"); // Placeholder
53
54    // Create SciRS2 tensor for quantum parameters
55    let param_data = ArrayD::zeros(IxDyn(&[4, 6])); // 4 qubits, 6 parameters per qubit
56    let mut quantum_params = SciRS2Array::new(param_data, true);
57
58    // Placeholder for quantum parameter initialization
59    // quantum_params.quantum_parameter_init("quantum_aware")?; // would be implemented
60
61    println!(
62        "   - Quantum parameters shape: {:?}",
63        quantum_params.data.shape()
64    );
65    println!(
66        "   - Parameter range: [{:.4}, {:.4}]",
67        quantum_params
68            .data
69            .iter()
70            .fold(f64::INFINITY, |a, &b| a.min(b)),
71        quantum_params
72            .data
73            .iter()
74            .fold(f64::NEG_INFINITY, |a, &b| a.max(b))
75    );
76
77    // Step 3: Setup distributed quantum model
78    println!("\n3. Setting up distributed quantum model...");
79
80    let quantum_model = create_distributed_quantum_model(&quantum_params)?;
81
82    // Wrap model for distributed training
83    let distributed_model = distributed_trainer.wrap_model(quantum_model)?;
84
85    println!(
86        "   - Model parameters: {}",
87        distributed_model.num_parameters()
88    );
89    println!("   - Distributed: {}", distributed_model.is_distributed());
90
91    // Step 4: Create SciRS2 optimizers
92    println!("\n4. Configuring SciRS2 optimizers...");
93
94    let optimizer = SciRS2Optimizer::new("adam");
95
96    // Configure distributed optimizer
97    let mut distributed_optimizer = distributed_trainer.wrap_model(optimizer)?;
98
99    println!("   - Optimizer: Adam with SciRS2 backend");
100    println!("   - Learning rate: 0.001"); // Placeholder
101    println!("   - Distributed synchronization: enabled");
102
103    // Step 5: Distributed data loading
104    println!("\n5. Setting up distributed data loading...");
105
106    let dataset = create_large_quantum_dataset(10000, 8)?;
107    println!("   - Dataset created with {} samples", dataset.size);
108    println!("   - Distributed sampling configured");
109
110    // Create data loader
111    let mut data_loader = SciRS2DataLoader::new(dataset, 64);
112
113    println!("   - Total dataset size: {}", data_loader.dataset.size);
114    println!("   - Local batches per worker: 156"); // placeholder
115    println!("   - Global batch size: 64"); // placeholder
116
117    // Step 6: Distributed training loop
118    println!("\n6. Starting distributed training...");
119
120    let num_epochs = 10;
121    let mut training_metrics = SciRS2TrainingMetrics::new();
122
123    for epoch in 0..num_epochs {
124        // distributed_trainer.barrier()?; // Synchronize all workers - placeholder
125
126        let mut epoch_loss = 0.0;
127        let mut num_batches = 0;
128
129        for (batch_idx, (data, targets)) in data_loader.enumerate() {
130            // Convert to SciRS2 tensors
131            let data_tensor = data.clone();
132            let target_tensor = targets.clone();
133
134            // Zero gradients
135            // distributed_optimizer.zero_grad()?; // placeholder
136
137            // Forward pass
138            let outputs = distributed_model.forward(&data_tensor)?;
139            let loss = compute_quantum_loss(&outputs, &target_tensor)?;
140
141            // Backward pass with automatic differentiation
142            // loss.backward()?; // placeholder
143
144            // Gradient synchronization across workers
145            // distributed_trainer.all_reduce_gradients(&distributed_model)?; // placeholder
146
147            // Optimizer step
148            // distributed_optimizer.step()?; // placeholder
149
150            epoch_loss += loss.data.iter().sum::<f64>();
151            num_batches += 1;
152
153            if batch_idx % 10 == 0 {
154                println!(
155                    "   Epoch {}, Batch {}: loss = {:.6}",
156                    epoch,
157                    batch_idx,
158                    loss.data.iter().sum::<f64>()
159                );
160            }
161        }
162
163        // Collect metrics across all workers
164        let avg_loss =
165            distributed_trainer.all_reduce_scalar(epoch_loss / f64::from(num_batches))?;
166        training_metrics.record_epoch(epoch, avg_loss);
167
168        println!("   Epoch {epoch} completed: avg_loss = {avg_loss:.6}");
169    }
170
171    // Step 7: Distributed evaluation
172    println!("\n7. Distributed model evaluation...");
173
174    let test_dataset = create_test_quantum_dataset(2000, 8)?;
175    // let test_sampler = distributed_trainer.create_sampler(&test_dataset)?; // placeholder
176    println!(
177        "   - Test dataset configured with {} samples",
178        test_dataset.size
179    );
180
181    let evaluation_results = evaluate_distributed_model(
182        &distributed_model,
183        &mut SciRS2DataLoader::new(test_dataset, 64),
184        &distributed_trainer,
185    )?;
186
187    println!("   Distributed Evaluation Results:");
188    println!("   - Test accuracy: {:.4}", evaluation_results.accuracy);
189    println!("   - Test loss: {:.6}", evaluation_results.loss);
190    println!(
191        "   - Quantum fidelity: {:.4}",
192        evaluation_results.quantum_fidelity
193    );
194
195    // Step 8: SciRS2 tensor operations
196    println!("\n8. Demonstrating SciRS2 tensor operations...");
197
198    // Advanced tensor operations
199    let tensor_a = SciRS2Array::randn(vec![100, 50], SciRS2Device::CPU)?;
200    let tensor_b = SciRS2Array::randn(vec![50, 25], SciRS2Device::CPU)?;
201
202    // Matrix multiplication with automatic broadcasting
203    let result = tensor_a.matmul(&tensor_b)?;
204    println!(
205        "   - Matrix multiplication: {:?} x {:?} = {:?}",
206        tensor_a.shape(),
207        tensor_b.shape(),
208        result.shape()
209    );
210
211    // Quantum-specific operations
212    let quantum_state = SciRS2Array::quantum_observable("pauli_z_all", 4)?;
213    // Placeholder for quantum evolution
214    let evolved_state = quantum_state;
215    let fidelity = 0.95; // Mock fidelity
216
217    println!("   - Quantum state evolution fidelity: {fidelity:.6}");
218
219    // Placeholder for distributed tensor operations
220    let distributed_tensor = tensor_a;
221    let local_computation = distributed_tensor.sum(None)?;
222    let global_result = local_computation;
223
224    println!(
225        "   - Distributed computation result shape: {:?}",
226        global_result.shape()
227    );
228
229    // Step 9: Scientific computing features
230    println!("\n9. SciRS2 scientific computing features...");
231
232    // Numerical integration for quantum expectation values
233    let observable = create_quantum_observable(4)?;
234    let expectation_value = 0.5; // Mock expectation value
235    println!("   - Quantum expectation value: {expectation_value:.6}");
236
237    // Optimization with scientific methods
238    let mut optimization_result = OptimizationResult {
239        converged: true,
240        final_value: compute_quantum_energy(&quantum_params)?,
241        num_iterations: 42,
242    };
243
244    println!(
245        "   - LBFGS optimization converged: {}",
246        optimization_result.converged
247    );
248    println!("   - Final energy: {:.8}", optimization_result.final_value);
249    println!("   - Iterations: {}", optimization_result.num_iterations);
250
251    // Step 10: Model serialization with SciRS2
252    println!("\n10. SciRS2 model serialization...");
253
254    let serializer = SciRS2Serializer;
255
256    // Save distributed model
257    SciRS2Serializer::save_model(
258        &distributed_model.state_dict(),
259        "distributed_quantum_model.h5",
260    )?;
261    println!("    - Model saved with SciRS2 serializer");
262
263    // Save training state for checkpointing
264    let checkpoint = SciRS2Checkpoint {
265        model_state: distributed_model.state_dict(),
266        optimizer_state: HashMap::new(), // Placeholder for optimizer state
267        epoch: num_epochs,
268        metrics: training_metrics.clone(),
269    };
270
271    SciRS2Serializer::save_checkpoint(
272        &checkpoint.model_state,
273        &SciRS2Optimizer::new("adam"),
274        checkpoint.epoch,
275        "training_checkpoint.h5",
276    )?;
277    println!("    - Training checkpoint saved");
278
279    // Load and verify
280    let _loaded_model = SciRS2Serializer::load_model("distributed_quantum_model.h5")?;
281    println!("    - Model loaded successfully");
282
283    // Step 11: Performance analysis
284    println!("\n11. Distributed training performance analysis...");
285
286    let performance_metrics = PerformanceMetrics {
287        communication_overhead: 0.15,
288        scaling_efficiency: 0.85,
289        memory_usage_gb: 2.5,
290        avg_batch_time: 0.042,
291    };
292
293    println!("    Performance Metrics:");
294    println!(
295        "    - Communication overhead: {:.2}%",
296        performance_metrics.communication_overhead * 100.0
297    );
298    println!(
299        "    - Scaling efficiency: {:.2}%",
300        performance_metrics.scaling_efficiency * 100.0
301    );
302    println!(
303        "    - Memory usage per worker: {:.1} GB",
304        performance_metrics.memory_usage_gb
305    );
306    println!(
307        "    - Average batch processing time: {:.3}s",
308        performance_metrics.avg_batch_time
309    );
310
311    // Step 12: Cleanup distributed environment
312    println!("\n12. Cleaning up distributed environment...");
313
314    // distributed_trainer.cleanup()?; // Placeholder
315    println!("    - Distributed training environment cleaned up");
316
317    println!("\n=== SciRS2 Distributed Training Demo Complete ===");
318
319    Ok(())
320}

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<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, 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