AdvancedTextCoordinator

Struct AdvancedTextCoordinator 

Source
pub struct AdvancedTextCoordinator { /* private fields */ }
Expand description

Advanced Text Processing Coordinator

The central intelligence system that coordinates all Advanced mode operations for text processing, providing adaptive optimization, intelligent resource management, and performance enhancement.

Implementations§

Source§

impl AdvancedTextCoordinator

Source

pub fn new(config: AdvancedTextConfig) -> Result<Self>

Create a new Advanced text coordinator

Examples found in repository?
examples/complete_integration.rs (line 83)
57    fn new() -> Result<Self> {
58        println!("🔧 Initializing Complete Advanced System...");
59
60        // Configure Advanced mode with optimized settings
61        let config = AdvancedTextConfig {
62            enable_gpu_acceleration: true,
63            enable_simd_optimizations: true,
64            enable_neural_ensemble: true,
65            enable_real_time_adaptation: true,
66            enable_advanced_analytics: true,
67            enable_multimodal: true,
68            max_memory_usage_mb: 8192,
69            optimization_level: 3,
70            target_throughput: 5000.0,
71            enable_predictive_processing: true,
72        };
73
74        // Performance monitoring with strict thresholds
75        let perf_thresholds = PerformanceThresholds {
76            max_processing_time_ms: 500, // 500ms max
77            min_throughput: 1000.0,      // 1000 docs/sec min
78            max_memory_usage_mb: 6144,   // 6GB max
79            max_cpu_utilization: 85.0,   // 85% max
80            min_cache_hit_rate: 0.85,    // 85% min
81        };
82
83        let coordinator = AdvancedTextCoordinator::new(config)?;
84        let performance_monitor = AdvancedPerformanceMonitor::with_thresholds(perf_thresholds);
85        let simd_processor = AdvancedSIMDTextProcessor;
86        let streaming_processor = AdvancedStreamingProcessor::new(WordTokenizer::default());
87
88        println!("✅ Advanced System initialized successfully!\n");
89
90        Ok(Self {
91            coordinator,
92            performance_monitor,
93            simd_processor,
94            streaming_processor,
95        })
96    }
More examples
Hide additional examples
examples/text_mode_demo.rs (line 61)
20fn main() -> Result<()> {
21    println!("🚀 Advanced Mode Demo - Advanced Text Processing");
22    println!("================================================\n");
23
24    // Configure Advanced mode with all advanced features enabled
25    let config = AdvancedTextConfig {
26        enable_gpu_acceleration: true,
27        enable_simd_optimizations: true,
28        enable_neural_ensemble: true,
29        enable_real_time_adaptation: true,
30        enable_advanced_analytics: true,
31        enable_multimodal: true,
32        max_memory_usage_mb: 4096, // 4GB for this demo
33        optimization_level: 3,     // Maximum optimization
34        target_throughput: 2000.0, // 2000 docs/sec target
35        enable_predictive_processing: true,
36    };
37
38    println!("📋 Configuration:");
39    println!("  • GPU Acceleration: {}", config.enable_gpu_acceleration);
40    println!(
41        "  • SIMD Optimizations: {}",
42        config.enable_simd_optimizations
43    );
44    println!("  • Neural Ensemble: {}", config.enable_neural_ensemble);
45    println!(
46        "  • Real-time Adaptation: {}",
47        config.enable_real_time_adaptation
48    );
49    println!(
50        "  • Advanced Analytics: {}",
51        config.enable_advanced_analytics
52    );
53    println!(
54        "  • Target Throughput: {} docs/sec",
55        config.target_throughput
56    );
57    println!("  • Memory Limit: {} MB\n", config.max_memory_usage_mb);
58
59    // Initialize the Advanced coordinator
60    println!("🔧 Initializing Advanced Text Coordinator...");
61    let coordinator = AdvancedTextCoordinator::new(config)?;
62    println!("✅ Coordinator initialized successfully!\n");
63
64    // Demo 1: Advanced-optimized text processing
65    demo_advancedtext_processing(&coordinator)?;
66
67    // Demo 2: Advanced semantic similarity
68    demo_semantic_similarity(&coordinator)?;
69
70    // Demo 3: Batch classification
71    demo_batch_classification(&coordinator)?;
72
73    // Demo 4: Dynamic topic modeling
74    demo_topic_modeling(&coordinator)?;
75
76    // Demo 5: Performance reporting
77    demo_performance_reporting(&coordinator)?;
78
79    println!("🎉 Advanced Mode Demo completed successfully!");
80    println!("All advanced features demonstrated with optimal performance.");
81
82    Ok(())
83}
Source

pub fn advanced_processtext( &self, texts: &[String], ) -> Result<AdvancedTextResult>

Advanced-optimized text processing with full feature coordination

Examples found in repository?
examples/complete_integration.rs (line 144)
119    fn demo_integrated_pipeline(&self) -> Result<()> {
120        println!("📊 Demo 1: Integrated Text Processing Pipeline");
121        println!("==============================================");
122
123        let sample_documents = vec![
124            "Artificial intelligence is revolutionizing the field of natural language processing.".to_string(),
125            "Machine learning algorithms can now understand context and semantic meaning in text.".to_string(),
126            "Deep neural networks have enabled breakthrough performance in text classification tasks.".to_string(),
127            "SIMD optimizations allow for optimized string processing in modern computing systems.".to_string(),
128            "Real-time adaptation ensures optimal performance across diverse text processing workloads.".to_string(),
129        ];
130
131        println!(
132            "Processing {} documents through integrated pipeline...",
133            sample_documents.len()
134        );
135
136        // Start performance monitoring
137        let operation_monitor = self
138            .performance_monitor
139            .start_operation("integrated_pipeline")?;
140
141        let start_time = Instant::now();
142
143        // Process through Advanced coordinator
144        let result = self.coordinator.advanced_processtext(&sample_documents)?;
145
146        let processing_time = start_time.elapsed();
147
148        // Complete monitoring
149        operation_monitor.complete(sample_documents.len())?;
150
151        println!("\n📈 Pipeline Results:");
152        println!("  • Processing Time: {processing_time:?}");
153        println!(
154            "  • Throughput: {:.2} docs/sec",
155            result.performance_metrics.throughput
156        );
157        println!(
158            "  • Memory Efficiency: {:.1}%",
159            result.performance_metrics.memory_efficiency * 100.0
160        );
161        println!(
162            "  • Accuracy Estimate: {:.1}%",
163            result.performance_metrics.accuracy_estimate * 100.0
164        );
165
166        println!("\n🔧 Applied Optimizations:");
167        for optimization in &result.optimizations_applied {
168            println!("  • {optimization}");
169        }
170
171        println!("\n🎯 Confidence Scores:");
172        for (metric, score) in &result.confidence_scores {
173            println!("  • {}: {:.1}%", metric, score * 100.0);
174        }
175
176        println!();
177        Ok(())
178    }
179
180    /// Demonstrate performance-monitored SIMD operations
181    fn demo_performance_monitored_simd(&self) -> Result<()> {
182        println!("⚡ Demo 2: Performance-Monitored SIMD Operations");
183        println!("===============================================");
184
185        let testtexts = [
186            "The quick brown fox jumps over the lazy dog".to_string(),
187            "Pack my box with five dozen liquor jugs".to_string(),
188            "How vexingly quick daft zebras jump!".to_string(),
189            "Bright vixens jump; dozy fowl quack".to_string(),
190        ];
191
192        println!("Running SIMD-accelerated operations with performance monitoring...");
193
194        // Start monitoring
195        let operation_monitor = self
196            .performance_monitor
197            .start_operation("simd_operations")?;
198
199        let start_time = Instant::now();
200
201        // Optimized text processing
202        let testtext_refs: Vec<&str> = testtexts.iter().map(|s| s.as_str()).collect();
203        let processed_results = AdvancedSIMDTextProcessor::advanced_batch_process(&testtext_refs);
204
205        // SIMD string operations
206        let char_counts: Vec<usize> = testtexts
207            .iter()
208            .map(|text| SimdStringOps::count_chars(text, 'o'))
209            .collect();
210
211        // Optimized similarity matrix
212        let similarity_matrix =
213            AdvancedSIMDTextProcessor::advanced_similarity_matrix(&testtext_refs);
214
215        let processing_time = start_time.elapsed();
216
217        // Complete monitoring
218        operation_monitor.complete(testtexts.len())?;
219
220        println!("\n📊 SIMD Operation Results:");
221        println!("  • Processing Time: {processing_time:?}");
222        println!("  • Documents Processed: {}", processed_results.len());
223        println!("  • Character Counts (letter 'o'): {char_counts:?}");
224        println!(
225            "  • Similarity Matrix Size: {}x{}",
226            similarity_matrix.len(),
227            similarity_matrix[0].len()
228        );
229
230        // Display similarity matrix
231        println!("\n🔗 Text Similarity Matrix:");
232        for (i, row) in similarity_matrix.iter().enumerate() {
233            print!("  Row {i}: [");
234            for (j, &similarity) in row.iter().enumerate() {
235                if j > 0 {
236                    print!(", ");
237                }
238                print!("{similarity:.3}");
239            }
240            println!("]");
241        }
242
243        // Show SIMD capabilities
244        println!("\n⚙️  SIMD Capabilities:");
245        println!("  • SIMD Available: {}", SimdStringOps::is_available());
246        println!("  • String Processing: Optimized");
247        println!("  • Pattern Matching: Optimized");
248        println!("  • Similarity Computation: Vectorized");
249
250        println!();
251        Ok(())
252    }
253
254    /// Demonstrate adaptive streaming processing
255    fn demo_adaptive_streaming(&self) -> Result<()> {
256        println!("🌊 Demo 3: Adaptive Streaming Processing");
257        println!("========================================");
258
259        // Create large dataset simulation
260        let largetexts: Vec<String> = (0..1000)
261            .map(|i| format!("This is streaming document number {i} with various content lengths and different patterns of text processing requirements."))
262            .collect();
263
264        println!(
265            "Processing {} documents through adaptive streaming...",
266            largetexts.len()
267        );
268
269        // Start monitoring
270        let operation_monitor = self
271            .performance_monitor
272            .start_operation("adaptive_streaming")?;
273
274        let start_time = Instant::now();
275
276        // Streaming processing with parallel optimization
277        let streaming_processor = AdvancedStreamingProcessor::new(WordTokenizer::default())
278            .with_parallelism(4, 1024 * 1024);
279
280        // Simple token counting for demonstration
281        let mut total_tokens = 0;
282        let tokenizer = WordTokenizer::default();
283        for text in &largetexts {
284            if let Ok(tokens) = tokenizer.tokenize(text) {
285                total_tokens += tokens.len();
286            }
287        }
288
289        let processing_time = start_time.elapsed();
290
291        // Complete monitoring
292        operation_monitor.complete(largetexts.len())?;
293
294        // Get memory stats instead of performance metrics
295        let (current_mem, peak_mem) = streaming_processor.memory_stats();
296
297        println!("\n📈 Streaming Processing Results:");
298        println!("  • Processing Time: {processing_time:?}");
299        println!("  • Documents Processed: {}", largetexts.len());
300        println!("  • Total Tokens Extracted: {total_tokens}");
301        println!("  • Current Memory Usage: {current_mem} bytes");
302        println!("  • Peak Memory Usage: {peak_mem} bytes");
303        println!(
304            "  • Throughput: {:.2} docs/sec",
305            largetexts.len() as f64 / processing_time.as_secs_f64()
306        );
307
308        println!("\n🔄 Advanced Features:");
309        println!("  • Parallel Processing: Enabled");
310        println!("  • Memory Monitoring: Active");
311        println!("  • Advanced Tokenization: Optimized");
312
313        println!();
314        Ok(())
315    }
316
317    /// Demonstrate real-time optimization and adaptation
318    fn demo_realtime_optimization(&self) -> Result<()> {
319        println!("🎯 Demo 4: Real-time Optimization and Adaptation");
320        println!("===============================================");
321
322        // Simulate various workload patterns
323        let workload_patterns = vec![
324            ("Short Documents", generate_short_documents(50)),
325            ("Medium Documents", generate_medium_documents(30)),
326            ("Long Documents", generate_long_documents(20)),
327            ("Mixed Workload", generate_mixed_workload(40)),
328        ];
329
330        for (pattern_name, documents) in workload_patterns {
331            println!("\n🔄 Processing Pattern: {pattern_name}");
332            println!("  • Document Count: {}", documents.len());
333
334            // Start monitoring for this pattern
335            let operation_monitor = self
336                .performance_monitor
337                .start_operation(&format!("pattern_{}", pattern_name.replace(' ', "_")))?;
338
339            let start_time = Instant::now();
340
341            // Process with adaptive optimization
342            let result = self.coordinator.advanced_processtext(&documents)?;
343
344            let processing_time = start_time.elapsed();
345
346            // Complete monitoring
347            operation_monitor.complete(documents.len())?;
348
349            println!("  • Processing Time: {processing_time:?}");
350            println!(
351                "  • Throughput: {:.2} docs/sec",
352                result.performance_metrics.throughput
353            );
354            println!(
355                "  • Optimizations Applied: {}",
356                result.optimizations_applied.len()
357            );
358
359            // Show adaptive responses
360            if !result.optimizations_applied.is_empty() {
361                println!("  • Adaptive Responses:");
362                for opt in &result.optimizations_applied {
363                    println!("    - {opt}");
364                }
365            }
366        }
367
368        // Get optimization recommendations
369        let recommendations = self.performance_monitor.get_optimization_opportunities()?;
370
371        println!("\n💡 Current Optimization Opportunities:");
372        if recommendations.is_empty() {
373            println!("  • No optimization opportunities identified");
374            println!("  • System is operating at optimal performance");
375        } else {
376            for (i, rec) in recommendations.iter().enumerate() {
377                println!("  {}. [{}] {}", i + 1, rec.category, rec.recommendation);
378                println!(
379                    "     Impact: {:.0}% | Complexity: {}/5",
380                    rec.impact_estimate * 100.0,
381                    rec.complexity
382                );
383            }
384        }
385
386        println!();
387        Ok(())
388    }
More examples
Hide additional examples
examples/text_mode_demo.rs (line 105)
87fn demo_advancedtext_processing(coordinator: &AdvancedTextCoordinator) -> Result<()> {
88    println!("📊 Demo 1: Advanced-Optimized Text Processing");
89    println!("==========================================");
90
91    let sampletexts = vec![
92        "Artificial intelligence is transforming the way we process and understand text data.".to_string(),
93        "Machine learning algorithms can extract meaningful patterns from large corpora of documents.".to_string(),
94        "Natural language processing combines computational linguistics with statistical analysis.".to_string(),
95        "Deep learning models like transformers have revolutionized text understanding tasks.".to_string(),
96        "The future of AI lies in developing more efficient and accurate language models.".to_string(),
97    ];
98
99    println!(
100        "Processing {} documents with Advanced optimization...",
101        sampletexts.len()
102    );
103
104    let start_time = std::time::Instant::now();
105    let result = coordinator.advanced_processtext(&sampletexts)?;
106    let processing_time = start_time.elapsed();
107
108    println!("\n📈 Results:");
109    println!("  • Processing Time: {processing_time:?}");
110    println!(
111        "  • Throughput: {:.2} docs/sec",
112        result.performance_metrics.throughput
113    );
114    println!(
115        "  • Memory Efficiency: {:.1}%",
116        result.performance_metrics.memory_efficiency * 100.0
117    );
118    println!(
119        "  • Accuracy Estimate: {:.1}%",
120        result.performance_metrics.accuracy_estimate * 100.0
121    );
122
123    println!("\n🔧 Optimizations Applied:");
124    for optimization in &result.optimizations_applied {
125        println!("  • {optimization}");
126    }
127
128    println!("\n⏱️  Timing Breakdown:");
129    println!(
130        "  • Preprocessing: {:?}",
131        result.timing_breakdown.preprocessing_time
132    );
133    println!(
134        "  • Neural Processing: {:?}",
135        result.timing_breakdown.neural_processing_time
136    );
137    println!(
138        "  • Analytics: {:?}",
139        result.timing_breakdown.analytics_time
140    );
141    println!(
142        "  • Optimization: {:?}",
143        result.timing_breakdown.optimization_time
144    );
145
146    println!("\n🎯 Confidence Scores:");
147    for (metric, score) in &result.confidence_scores {
148        println!("  • {}: {:.1}%", metric, score * 100.0);
149    }
150
151    println!(
152        "\n📐 Vector Embeddings Shape: {:?}",
153        result.primary_result.vectors.shape()
154    );
155    println!();
156
157    Ok(())
158}
Source

pub fn advanced_semantic_similarity( &self, text1: &str, text2: &str, ) -> Result<AdvancedSemanticSimilarityResult>

Optimized semantic similarity with advanced optimizations

Examples found in repository?
examples/text_mode_demo.rs (line 180)
162fn demo_semantic_similarity(coordinator: &AdvancedTextCoordinator) -> Result<()> {
163    println!("🔍 Demo 2: Advanced Semantic Similarity");
164    println!("=======================================");
165
166    let text_pairs = [
167        ("The cat sat on the mat", "A feline rested on the rug"),
168        (
169            "Machine learning is a subset of artificial intelligence",
170            "AI includes machine learning as one of its components",
171        ),
172        ("The weather is sunny today", "It's raining heavily outside"),
173    ];
174
175    for (i, (text1, text2)) in text_pairs.iter().enumerate() {
176        println!("\n📝 Text Pair {}:", i + 1);
177        println!("  Text 1: \"{text1}\"");
178        println!("  Text 2: \"{text2}\"");
179
180        let result = coordinator.advanced_semantic_similarity(text1, text2)?;
181
182        println!("\n📊 Similarity Metrics:");
183        println!("  • Cosine Similarity: {:.3}", result.cosine_similarity);
184        println!("  • Semantic Similarity: {:.3}", result.semantic_similarity);
185        println!(
186            "  • Contextual Similarity: {:.3}",
187            result.contextual_similarity
188        );
189        println!("  • Confidence Score: {:.3}", result.confidence_score);
190        println!("  • Processing Time: {:?}", result.processing_time);
191    }
192
193    println!();
194    Ok(())
195}
Source

pub fn advanced_classify_batch( &self, texts: &[String], categories: &[String], ) -> Result<AdvancedBatchClassificationResult>

Advanced-optimized batch text classification

Examples found in repository?
examples/text_mode_demo.rs (line 225)
199fn demo_batch_classification(coordinator: &AdvancedTextCoordinator) -> Result<()> {
200    println!("🏷️  Demo 3: Batch Text Classification");
201    println!("===================================");
202
203    let texts = vec![
204        "This movie was absolutely fantastic! Great acting and storyline.".to_string(),
205        "The service at this restaurant was terrible and the food was cold.".to_string(),
206        "The new software update includes several bug fixes and performance improvements."
207            .to_string(),
208        "Breaking news: Major earthquake hits the coastal region.".to_string(),
209    ];
210
211    let categories = vec![
212        "positive_review".to_string(),
213        "negative_review".to_string(),
214        "technology".to_string(),
215        "news".to_string(),
216    ];
217
218    println!(
219        "Classifying {} texts into {} categories...",
220        texts.len(),
221        categories.len()
222    );
223    println!("\n📊 Categories: {categories:?}");
224
225    let result = coordinator.advanced_classify_batch(&texts, &categories)?;
226
227    println!("\n📈 Classification Results:");
228    println!(
229        "  • Total Classifications: {}",
230        result.classifications.len()
231    );
232    println!(
233        "  • Average Confidence: {:.1}%",
234        result.confidence_estimates.iter().sum::<f64>() / result.confidence_estimates.len() as f64
235            * 100.0
236    );
237    println!("  • Processing Time: {:?}", result.processing_time);
238    println!(
239        "  • Throughput: {:.2} docs/sec",
240        result.performance_metrics.throughput
241    );
242
243    for (i, confidence) in result.confidence_estimates.iter().enumerate() {
244        println!("  • Text {}: {:.1}% confidence", i + 1, confidence * 100.0);
245    }
246
247    println!();
248    Ok(())
249}
Source

pub fn advanced_topic_modeling( &self, documents: &[String], num_topics: usize, ) -> Result<AdvancedTopicModelingResult>

Advanced-advanced topic modeling with dynamic optimization

Examples found in repository?
examples/text_mode_demo.rs (line 274)
253fn demo_topic_modeling(coordinator: &AdvancedTextCoordinator) -> Result<()> {
254    println!("📚 Demo 4: Dynamic Topic Modeling");
255    println!("================================");
256
257    let documents = vec![
258        "Machine learning algorithms are used to build predictive models from data.".to_string(),
259        "Deep neural networks can learn complex patterns in high-dimensional data.".to_string(),
260        "Natural language processing helps computers understand human language.".to_string(),
261        "Computer vision enables machines to interpret and analyze visual information.".to_string(),
262        "Reinforcement learning trains agents to make decisions through trial and error."
263            .to_string(),
264        "Data science combines statistics, programming, and domain expertise.".to_string(),
265        "Artificial intelligence aims to create systems that can perform human-like tasks."
266            .to_string(),
267    ];
268
269    println!(
270        "Analyzing {} documents for topic extraction...",
271        documents.len()
272    );
273
274    let result = coordinator.advanced_topic_modeling(&documents, 3)?; // Extract 3 topics
275
276    println!("\n📊 Topic Modeling Results:");
277    println!("  • Processing Time: {:?}", result.processing_time);
278
279    println!("\n📈 Quality Metrics:");
280    println!(
281        "  • Coherence Score: {:.3}",
282        result.quality_metrics.coherence_score
283    );
284    println!(
285        "  • Diversity Score: {:.3}",
286        result.quality_metrics.diversity_score
287    );
288    println!(
289        "  • Stability Score: {:.3}",
290        result.quality_metrics.stability_score
291    );
292    println!(
293        "  • Interpretability Score: {:.3}",
294        result.quality_metrics.interpretability_score
295    );
296
297    println!();
298    Ok(())
299}
Source

pub fn get_performance_report(&self) -> Result<AdvancedTextPerformanceReport>

Get comprehensive performance report

Examples found in repository?
examples/text_mode_demo.rs (line 307)
303fn demo_performance_reporting(coordinator: &AdvancedTextCoordinator) -> Result<()> {
304    println!("📊 Demo 5: Performance Reporting");
305    println!("===============================");
306
307    let report = coordinator.get_performance_report()?;
308
309    println!("\n🔧 Current Performance Metrics:");
310    println!(
311        "  • Processing Time: {:?}",
312        report.current_metrics.processing_time
313    );
314    println!(
315        "  • Throughput: {:.2} docs/sec",
316        report.current_metrics.throughput
317    );
318    println!(
319        "  • Memory Efficiency: {:.1}%",
320        report.current_metrics.memory_efficiency * 100.0
321    );
322    println!(
323        "  • Accuracy Estimate: {:.1}%",
324        report.current_metrics.accuracy_estimate * 100.0
325    );
326
327    println!("\n🖥️  System Utilization:");
328    println!("  • CPU: {:.1}%", report.system_utilization.cpu_utilization);
329    println!(
330        "  • Memory: {:.1}%",
331        report.system_utilization.memory_utilization
332    );
333    println!("  • GPU: {:.1}%", report.system_utilization.gpu_utilization);
334    println!(
335        "  • Cache Hit Rate: {:.1}%",
336        report.system_utilization.cache_hit_rate * 100.0
337    );
338
339    println!("\n💡 Optimization Recommendations:");
340    for recommendation in &report.optimization_recommendations {
341        println!(
342            "  • [{}] {} (Impact: {:.0}%)",
343            recommendation.category,
344            recommendation.recommendation,
345            recommendation.impact_estimate * 100.0
346        );
347    }
348
349    println!("\n⚠️  Performance Bottlenecks:");
350    for bottleneck in &report.bottleneck_analysis {
351        println!(
352            "  • {} ({:.0}% impact): {}",
353            bottleneck.component,
354            bottleneck.impact * 100.0,
355            bottleneck.description
356        );
357        println!("    Suggestion: {}", bottleneck.suggested_fix);
358    }
359
360    println!();
361    Ok(())
362}

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