tightbeam-rs 0.6.2

A secure, high-performance messaging protocol library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
//! Cluster framework for servlet orchestration
//!
//! Clusters are gateways that receive work requests from external clients
//! and route them to registered hives/hives based on servlet type.
//!
//! # Architecture
//!
//! 1. **Hives/Drones register** with the cluster, announcing available servlet types
//! 2. **Cluster maintains registry** of hives and their capabilities
//! 3. **Clients send** `ClusterWorkRequest` with `servlet_type` and `payload`
//! 4. **Cluster routes** to a hive that supports the requested servlet type
//! 5. **Cluster forwards** payload and returns response to client

pub mod builder;
pub mod error;
pub mod macros;
pub mod registry;
pub mod servlet_registry;

// Re-export submodule types
pub use builder::{ClusterConfBuilder, HeartbeatConfBuilder};
pub use error::ClusterError;
pub use registry::{HiveEntry, HiveRegistry, SharedId};
pub use servlet_registry::{PheromoneConf, ServletEntry, ServletRegistry};

use core::future::Future;
use core::marker::PhantomData;
use core::time::Duration;
use std::sync::Arc;

use crate::crypto::hash::{Digest, Sha3_256};
use crate::crypto::key::SigningKeyProvider;
use crate::der::Sequence;
use crate::policy::{GatePolicy, TransitStatus};
use crate::trace::TraceCollector;
use crate::transport::client::pool::PoolConfig;
use crate::transport::policy::RestartPolicy;
use crate::transport::{Protocol, TightBeamAddress};
use crate::Beamable;

#[cfg(feature = "x509")]
use crate::crypto::x509::{policy::CertificateValidation, CertificateSpec};

use super::common::LeastLoaded;
use super::hive::LoadBalancer;

#[cfg(feature = "tokio")]
use crate::colony::servlet::servlet_runtime::rt;

// =============================================================================
// Configuration
// =============================================================================

// Heartbeat default constants (single source of truth)
pub(crate) const DEFAULT_HEARTBEAT_INTERVAL_SECS: u64 = 5;
pub(crate) const DEFAULT_HEARTBEAT_TIMEOUT_SECS: u64 = 15;
pub(crate) const DEFAULT_MAX_CONCURRENT: usize = 10;
pub(crate) const DEFAULT_MAX_FAILURES: u32 = 3;

/// Configuration for cluster heartbeat behavior
pub struct HeartbeatConf {
	/// Interval between heartbeat checks
	pub interval: Duration,
	/// Timeout before evicting unresponsive hives
	pub timeout: Duration,
	/// Optional retry policy override (uses ClusterConf.retry_policy if None)
	pub retry_policy: Option<Arc<dyn RestartPolicy + Send + Sync>>,
	/// Maximum concurrent heartbeat requests
	pub max_concurrent: usize,
	/// Failed heartbeats before eviction
	pub max_failures: u32,
	/// Optional callback for heartbeat events (monitoring, testing)
	pub on_heartbeat: Option<HeartbeatCallback>,
}

impl Default for HeartbeatConf {
	fn default() -> Self {
		Self {
			interval: Duration::from_secs(DEFAULT_HEARTBEAT_INTERVAL_SECS),
			timeout: Duration::from_secs(DEFAULT_HEARTBEAT_TIMEOUT_SECS),
			retry_policy: None,
			max_concurrent: DEFAULT_MAX_CONCURRENT,
			max_failures: DEFAULT_MAX_FAILURES,
			on_heartbeat: None,
		}
	}
}

impl core::fmt::Debug for HeartbeatConf {
	fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
		f.debug_struct("HeartbeatConf")
			.field("interval", &self.interval)
			.field("timeout", &self.timeout)
			.field("retry_policy", &self.retry_policy.as_ref().map(|_| "Some(...)"))
			.field("max_concurrent", &self.max_concurrent)
			.field("max_failures", &self.max_failures)
			.field("on_heartbeat", &self.on_heartbeat.as_ref().map(|_| "Some(...)"))
			.finish()
	}
}

impl HeartbeatConf {
	/// Add a callback to be invoked on each heartbeat result
	pub fn with_callback(mut self, callback: HeartbeatCallback) -> Self {
		self.on_heartbeat = Some(callback);
		self
	}
}

// =============================================================================
// Heartbeat Callback
// =============================================================================

/// Event emitted for each heartbeat result
///
/// Provides information about the heartbeat outcome for monitoring,
/// metrics collection, or testing purposes.
#[derive(Debug, Clone)]
pub struct HeartbeatEvent {
	/// Address of the hive that was checked
	pub hive_addr: Arc<[u8]>,
	/// Whether the heartbeat succeeded
	pub success: bool,
	/// Utilization reported by the hive (if successful)
	pub utilization: Option<crate::utils::BasisPoints>,
}

/// Callback type for heartbeat events
///
/// Called after each heartbeat result is processed. The callback must be
/// thread-safe (`Send + Sync`) as it may be invoked from multiple concurrent
/// heartbeat tasks.
pub type HeartbeatCallback = Arc<dyn Fn(HeartbeatEvent) + Send + Sync>;

// ============================================================================
// TLS Configuration
// ============================================================================

/// TLS configuration for cluster → hive connections
///
/// Contains certificate, key, and validators for encrypted transport.
/// Used by the connection pool for mutual TLS with hives.
#[cfg(feature = "x509")]
pub struct ClusterTlsConfig {
	/// Cluster's certificate (used for both client and hive connections)
	pub certificate: CertificateSpec,
	/// Private key provider for signing operations (supports HSM/KMS)
	pub key: Arc<dyn SigningKeyProvider>,
	/// Server certificate validators for hive connections (cluster→hive)
	pub validators: Vec<Arc<dyn CertificateValidation>>,
	/// Client certificate validators for mutual auth (client→cluster)
	pub client_validators: Vec<Arc<dyn CertificateValidation>>,
	/// Trust store for validating hive/servlet server certificates (outbound connections)
	pub hive_trust: Option<Arc<dyn crate::crypto::x509::store::CertificateTrust>>,
}

#[cfg(feature = "x509")]
impl Clone for ClusterTlsConfig {
	fn clone(&self) -> Self {
		Self {
			certificate: self.certificate.clone(),
			key: Arc::clone(&self.key),
			validators: self.validators.clone(),
			client_validators: self.client_validators.clone(),
			hive_trust: self.hive_trust.as_ref().map(Arc::clone),
		}
	}
}

#[cfg(feature = "x509")]
impl core::fmt::Debug for ClusterTlsConfig {
	fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
		f.debug_struct("ClusterTlsConfig")
			.field("certificate", &self.certificate)
			.field("key", &"<KeyProvider>")
			.field("validators", &format!("[{} validators]", self.validators.len()))
			.field("client_validators", &format!("[{} validators]", self.client_validators.len()))
			.field("hive_trust", &self.hive_trust.as_ref().map(|_| "Some(<TrustStore>)"))
			.finish()
	}
}

/// Configuration for clusters
///
/// Contains settings for load balancing, health checks, gateway policies,
/// and cryptographic signing for cluster → hive communication.
///
/// # Type Parameters
/// - `L`: Load balancing strategy (default: `LeastLoaded`)
/// - `D`: Digest algorithm for frame integrity and signing (default: `Sha3_256`)
pub struct ClusterConf<L: LoadBalancer = LeastLoaded, D: Digest = Sha3_256> {
	/// Load balancing strategy for distributing work across hives
	pub load_balancer: L,
	/// Heartbeat configuration
	pub heartbeat: HeartbeatConf,
	/// Pheromone configuration for bio-inspired routing
	pub pheromone: PheromoneConf,
	/// Gate policies for the gateway (rate limiting, auth, etc.)
	pub policies: Vec<Arc<dyn GatePolicy + Send + Sync>>,
	/// Connection pool configuration for hive connections
	pub pool_config: PoolConfig,
	/// Default retry policy for all cluster → hive communication
	pub retry_policy: Arc<dyn RestartPolicy + Send + Sync>,
	/// TLS configuration for cluster → hive connections
	#[cfg(feature = "x509")]
	pub tls: ClusterTlsConfig,
	/// Phantom data for digest type
	pub(crate) _digest: PhantomData<D>,
}

#[cfg(feature = "x509")]
impl ClusterConf {
	/// Create a new cluster configuration with TLS config
	pub fn new(tls: ClusterTlsConfig) -> Self {
		Self::builder(tls).build()
	}
}

#[cfg(feature = "x509")]
impl<L: LoadBalancer, D: Digest> core::fmt::Debug for ClusterConf<L, D> {
	fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
		f.debug_struct("ClusterConfig")
			.field("heartbeat", &self.heartbeat)
			.field("pheromone", &self.pheromone)
			.field("policies", &format!("[{} policies]", self.policies.len()))
			.field("pool_config", &self.pool_config)
			.field("tls", &self.tls)
			.finish()
	}
}

// =============================================================================
// Work Request/Response Messages
// =============================================================================

/// Work request envelope for cluster routing
///
/// Clients send this to the cluster gateway. The cluster routes based on
/// `servlet_type` and forwards `payload` to the selected hive.
#[derive(Debug, Beamable, Sequence, Clone, PartialEq)]
pub struct ClusterWorkRequest {
	/// Target servlet type (e.g., b"ping_servlet")
	pub servlet_type: Vec<u8>,
	/// Raw message payload (encoded inner message)
	pub payload: Vec<u8>,
}

/// Work response from cluster
#[derive(Debug, Beamable, Sequence, Clone, PartialEq)]
pub struct ClusterWorkResponse {
	/// Status of the routing/execution
	pub status: TransitStatus,
	/// Response payload from servlet (if successful)
	pub payload: Option<Vec<u8>>,
}

impl ClusterWorkResponse {
	/// Create a successful response with payload
	#[inline]
	pub fn ok(payload: Vec<u8>) -> Self {
		Self { status: TransitStatus::Accepted, payload: Some(payload) }
	}

	/// Create an error response with status
	#[inline]
	pub fn err(status: TransitStatus) -> Self {
		Self { status, payload: None }
	}
}

// =============================================================================
// Cluster Trait
// =============================================================================

/// Trait for cluster implementations
///
/// Clusters are gateways that route work requests to registered hives
/// based on servlet type. Hives register dynamically, and the cluster
/// learns available servlet types from their registrations.
pub trait Cluster: Sized + Send + Sync {
	/// The protocol type this cluster uses
	type Protocol: Protocol;

	/// Address type for this cluster
	type Address: TightBeamAddress;

	/// Start the cluster gateway
	fn start(
		trace: Arc<TraceCollector>,
		config: ClusterConf,
	) -> impl Future<Output = Result<Self, crate::TightBeamError>> + Send;

	/// Get the gateway address
	fn addr(&self) -> Self::Address;

	/// Get available servlet types (from registered hives)
	fn available_servlets(&self) -> Vec<Vec<u8>>;

	/// Get the number of registered hives
	fn hive_count(&self) -> usize;

	/// Get the trace collector
	fn trace(&self) -> Arc<TraceCollector>;

	/// Stop the cluster
	fn stop(self);

	/// Wait for the cluster to finish
	fn join(self) -> impl Future<Output = Result<(), crate::colony::servlet::servlet_runtime::rt::JoinError>> + Send;

	// =========================================================================
	// Heartbeat Methods
	// =========================================================================

	/// Access the hive registry
	fn registry(&self) -> &Arc<HiveRegistry>;

	/// Access heartbeat configuration
	fn heartbeat_config(&self) -> &HeartbeatConf;

	/// Send a single heartbeat to a hive
	///
	/// Builds a signed heartbeat frame and sends it via the connection pool.
	/// Returns the heartbeat result from the hive.
	fn send_heartbeat(
		&self,
		addr: Self::Address,
	) -> impl Future<Output = Result<super::common::HeartbeatResult, ClusterError>> + Send;

	/// Process a heartbeat result, updating registry accordingly
	///
	/// On success, updates the hive's utilization metric.
	/// On failure, increments the failure counter and evicts if threshold exceeded.
	fn process_heartbeat_result(&self, hive_addr: &[u8], result: Result<super::common::HeartbeatResult, ClusterError>) {
		match result {
			Ok(hb) => {
				let _ = self.registry().touch(hive_addr, hb.utilization);
			}
			Err(_) => {
				if let Ok(failures) = self.registry().increment_failure(hive_addr) {
					if failures >= self.heartbeat_config().max_failures {
						let _ = self.registry().unregister(hive_addr);
					}
				}
			}
		}
	}

	// =========================================================================
	// Heartbeat Loop - Default Trait Implementation
	// =========================================================================
	//
	// Note: The cluster! macro provides optimized implementations with proper
	// concurrency. These trait defaults are simpler fallbacks.

	/// Tier 1: Tokio - sequential async processing
	///
	/// Default implementation processes heartbeats sequentially.
	/// The macro-generated implementation uses JoinSet for concurrency.
	#[cfg(feature = "tokio")]
	fn run_heartbeat_loop(&self) -> impl Future<Output = ()> + Send
	where
		Self::Address: core::str::FromStr,
	{
		async move {
			loop {
				// Collect parsed addresses first
				let tasks: Vec<_> = self
					.registry()
					.all_hives()
					.unwrap_or_default()
					.into_iter()
					.filter_map(|hive| {
						let hive_addr = Arc::clone(&hive.address);
						core::str::from_utf8(&hive_addr)
							.ok()
							.and_then(|s| s.parse().ok())
							.map(|addr| (hive_addr, addr))
					})
					.collect();

				// Concurrent processing with futures
				#[cfg(feature = "futures")]
				{
					use futures::stream::{self, StreamExt};

					let max_concurrent = self.heartbeat_config().max_concurrent;
					stream::iter(tasks)
						.for_each_concurrent(max_concurrent, |(hive_addr, addr)| async move {
							let result = self.send_heartbeat(addr).await;
							self.process_heartbeat_result(&hive_addr, result);
						})
						.await;
				}

				// Sequential fallback without futures
				#[cfg(not(feature = "futures"))]
				for (hive_addr, addr) in tasks {
					let result = self.send_heartbeat(addr).await;
					self.process_heartbeat_result(&hive_addr, result);
				}

				rt::sleep(self.heartbeat_config().interval).await;
			}
		}
	}

	/// Tier 2: std + futures - sequential with block_on
	///
	/// For non-tokio builds with futures crate.
	#[cfg(all(not(feature = "tokio"), feature = "std", feature = "futures"))]
	fn run_heartbeat_loop(&self)
	where
		Self::Address: core::str::FromStr,
	{
		use futures::executor::block_on;

		loop {
			self.registry()
				.all_hives()
				.unwrap_or_default()
				.into_iter()
				.filter_map(|hive| {
					let hive_addr = Arc::clone(&hive.address);
					core::str::from_utf8(&hive_addr)
						.ok()
						.and_then(|s| s.parse().ok())
						.map(|addr| (hive_addr, addr))
				})
				.for_each(|(hive_addr, addr)| {
					let result = block_on(self.send_heartbeat(addr));
					self.process_heartbeat_result(&hive_addr, result);
				});

			std::thread::sleep(self.heartbeat_config().interval);
		}
	}

	/// Tier 3: std only - placeholder
	///
	/// For std builds without tokio or futures.
	/// Cannot call async send_heartbeat - placeholder only.
	#[cfg(all(not(feature = "tokio"), feature = "std", not(feature = "futures")))]
	fn run_heartbeat_loop(&self)
	where
		Self::Address: core::str::FromStr,
	{
		loop {
			self.registry()
				.all_hives()
				.unwrap_or_default()
				.into_iter()
				.filter_map(|hive| {
					let hive_addr = Arc::clone(&hive.address);
					core::str::from_utf8(&hive_addr)
						.ok()
						.and_then(|s| s.parse::<Self::Address>().ok())
						.map(|addr| (hive_addr, addr))
				})
				.for_each(|(hive_addr, _addr)| {
					// Note: Cannot call async send_heartbeat without executor
					// Increment failure as placeholder behavior
					let _ = self.registry().increment_failure(&hive_addr);
				});

			std::thread::sleep(self.heartbeat_config().interval);
		}
	}
}

// =============================================================================
// Tests
// =============================================================================

#[cfg(test)]
mod tests {
	use super::*;
	use crate::colony::common::RegisterHiveRequest;
	use crate::colony::hive::ServletInfo;
	use crate::crypto::key::Secp256k1KeyProvider;
	use crate::crypto::sign::ecdsa::Secp256k1SigningKey;
	use crate::testing::create_test_signing_key;
	use crate::utils::BasisPoints;

	// =========================================================================
	// Test Helpers
	// =========================================================================

	fn test_tls_config() -> ClusterTlsConfig {
		let key: Secp256k1SigningKey = create_test_signing_key();
		ClusterTlsConfig {
			certificate: CertificateSpec::Der(&[]),
			key: Arc::new(Secp256k1KeyProvider::from(key)),
			validators: Vec::new(),
			client_validators: Vec::new(),
			hive_trust: None,
		}
	}

	fn test_registry() -> HiveRegistry {
		HiveRegistry::new(Duration::from_secs(15))
	}

	fn request(addr: &[u8], servlets: &[&[u8]]) -> RegisterHiveRequest {
		RegisterHiveRequest {
			hive_addr: addr.to_vec(),
			metadata: None,
			servlet_addresses: servlets
				.iter()
				.map(|s| ServletInfo { servlet_id: s.to_vec(), address: addr.to_vec() })
				.collect(),
		}
	}

	fn request_with_meta(addr: &[u8], servlets: &[&[u8]], meta: &[u8]) -> RegisterHiveRequest {
		RegisterHiveRequest {
			hive_addr: addr.to_vec(),
			metadata: Some(meta.to_vec()),
			servlet_addresses: servlets
				.iter()
				.map(|s| ServletInfo { servlet_id: s.to_vec(), address: addr.to_vec() })
				.collect(),
		}
	}

	// =========================================================================
	// ClusterConf Tests
	// =========================================================================

	#[test]
	fn cluster_conf_defaults() {
		let config = ClusterConf::new(test_tls_config());
		assert_eq!(config.heartbeat.interval, Duration::from_secs(5));
		assert_eq!(config.heartbeat.timeout, Duration::from_secs(15));
		assert!(config.policies.is_empty());
	}

	// =========================================================================
	// ClusterWorkResponse Tests
	// =========================================================================

	#[test]
	fn work_response_ok() {
		let response = ClusterWorkResponse::ok(b"test".to_vec());
		assert_eq!(response.status, TransitStatus::Accepted);
		assert_eq!(response.payload, Some(b"test".to_vec()));
	}

	#[test]
	fn work_response_err() {
		let response = ClusterWorkResponse::err(TransitStatus::Forbidden);
		assert_eq!(response.status, TransitStatus::Forbidden);
		assert!(response.payload.is_none());
	}

	// =========================================================================
	// HiveRegistry Tests
	// =========================================================================

	#[test]
	fn registry_register_and_lookup() -> Result<(), ClusterError> {
		let registry = test_registry();
		registry.register(request(b"127.0.0.1:8080", &[b"ping", b"calc"]))?;

		// Registered types found
		assert_eq!(registry.hives_for_type(b"ping")?.len(), 1);
		assert_eq!(registry.hives_for_type(b"calc")?.len(), 1);
		assert_eq!(registry.hives_for_type(b"ping")?[0].address.as_ref(), b"127.0.0.1:8080");

		// Unknown type not found
		assert!(registry.hives_for_type(b"unknown")?.is_empty());

		Ok(())
	}

	#[test]
	fn registry_unregister() -> Result<(), ClusterError> {
		let registry = test_registry();
		registry.register(request(b"127.0.0.1:8080", &[b"ping"]))?;

		assert_eq!(registry.len()?, 1);
		assert!(registry.unregister(b"127.0.0.1:8080")?.is_some());
		assert_eq!(registry.len()?, 0);
		assert!(registry.hives_for_type(b"ping")?.is_empty());

		Ok(())
	}

	#[test]
	fn registry_update_utilization() -> Result<(), ClusterError> {
		let registry = test_registry();
		registry.register(request(b"127.0.0.1:8080", &[b"ping"]))?;

		assert!(registry.update_utilization(b"127.0.0.1:8080", BasisPoints::new(5000))?);
		assert_eq!(registry.hives_for_type(b"ping")?[0].utilization.get(), 5000);

		Ok(())
	}

	#[test]
	fn registry_available_servlets_deduplicated() -> Result<(), ClusterError> {
		let registry = test_registry();
		registry.register(request(b"hive1", &[b"ping", b"calc"]))?;
		registry.register(request(b"hive2", &[b"ping", b"worker"]))?;

		// ping, calc, worker - ping deduplicated
		assert_eq!(registry.to_available_servlets()?.len(), 3);

		Ok(())
	}

	#[test]
	fn registry_multiple_hives_same_type() -> Result<(), ClusterError> {
		let registry = test_registry();
		registry.register(request(b"hive1", &[b"ping"]))?;
		registry.register(request(b"hive2", &[b"ping"]))?;

		assert_eq!(registry.hives_for_type(b"ping")?.len(), 2);

		Ok(())
	}

	#[test]
	fn registry_all_hives() -> Result<(), ClusterError> {
		let registry = test_registry();
		registry.register(request(b"hive1", &[b"ping"]))?;
		registry.register(request_with_meta(b"hive2", &[b"calc"], b"metadata"))?;

		let all = registry.all_hives()?;
		assert_eq!(all.len(), 2);

		let addrs: Vec<_> = all.iter().map(|e| e.address.as_ref()).collect();
		assert!(addrs.contains(&b"hive1".as_slice()));
		assert!(addrs.contains(&b"hive2".as_slice()));

		Ok(())
	}
}