TypedBuffer

Struct TypedBuffer 

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

Safe wrapper around ZL_TypedBuffer for typed decompression output.

TypedBuffer owns its internal buffer and frees it on Drop.

Implementations§

Source§

impl TypedBuffer

Source

pub fn new() -> Self

Create a new TypedBuffer for receiving decompressed data

Source

pub fn data_type(&self) -> ZL_Type

Get the data type of this buffer

Examples found in repository?
examples/typed_compression.rs (line 21)
8fn main() -> Result<(), Box<dyn std::error::Error>> {
9    println!("=== TypedRef Compression Examples ===\n");
10
11    // Example 1: Serial (untyped) data
12    println!("Example 1: Serial TypedRef");
13    let text = b"Hello from TypedRef! This is untyped byte data.";
14    let tref_serial = TypedRef::serial(text);
15
16    let compressed = compress_typed_ref(&tref_serial)?;
17    let tbuf = decompress_typed_buffer(&compressed)?;
18
19    println!("  Original size: {} bytes", text.len());
20    println!("  Compressed size: {} bytes", compressed.len());
21    println!("  Data type: {:?}", tbuf.data_type());
22
23    assert_eq!(text.as_slice(), tbuf.as_bytes());
24    println!("  ✓ Round-trip successful!\n");
25
26    // Example 2: Numeric u32 data
27    println!("Example 2: Numeric TypedRef (u32)");
28    let numbers: Vec<u32> = (0..1000).collect();
29    let tref_numeric = TypedRef::numeric(&numbers)?;
30
31    let compressed = compress_typed_ref(&tref_numeric)?;
32    let tbuf = decompress_typed_buffer(&compressed)?;
33
34    let original_size = numbers.len() * std::mem::size_of::<u32>();
35    println!("  Original size: {} bytes ({} elements)", original_size, numbers.len());
36    println!("  Compressed size: {} bytes", compressed.len());
37    println!(
38        "  Compression ratio: {:.2}%",
39        (compressed.len() as f64 / original_size as f64) * 100.0
40    );
41    println!("  Data type: {:?}", tbuf.data_type());
42    println!("  Element width: {} bytes", tbuf.elt_width());
43    println!("  Element count: {}", tbuf.num_elts());
44
45    let decompressed = tbuf.as_numeric::<u32>().expect("Failed to extract u32 data");
46    assert_eq!(numbers.as_slice(), decompressed);
47    println!("  ✓ Round-trip successful!\n");
48
49    // Example 3: Numeric u64 data
50    println!("Example 3: Numeric TypedRef (u64)");
51    let large_numbers: Vec<u64> = (0..500).map(|i| i * 1000000).collect();
52    let tref_numeric = TypedRef::numeric(&large_numbers)?;
53
54    let compressed = compress_typed_ref(&tref_numeric)?;
55    let tbuf = decompress_typed_buffer(&compressed)?;
56
57    let original_size = large_numbers.len() * std::mem::size_of::<u64>();
58    println!("  Original size: {} bytes ({} elements)", original_size, large_numbers.len());
59    println!("  Compressed size: {} bytes", compressed.len());
60    println!(
61        "  Compression ratio: {:.2}%",
62        (compressed.len() as f64 / original_size as f64) * 100.0
63    );
64
65    let decompressed = tbuf.as_numeric::<u64>().expect("Failed to extract u64 data");
66    assert_eq!(large_numbers.as_slice(), decompressed);
67    println!("  ✓ Round-trip successful!\n");
68
69    // Example 4: Struct data
70    println!("Example 4: Struct TypedRef");
71
72    // Simulate a simple struct as raw bytes: [id: u32, value: u32]
73    let struct_width = 8; // 2 * sizeof(u32)
74    let struct_count = 100;
75    let mut struct_data = Vec::with_capacity(struct_width * struct_count);
76
77    for i in 0..struct_count {
78        // Write id (u32)
79        struct_data.extend_from_slice(&(i as u32).to_le_bytes());
80        // Write value (u32)
81        struct_data.extend_from_slice(&((i * 10) as u32).to_le_bytes());
82    }
83
84    let tref_struct = TypedRef::structs(&struct_data, struct_width, struct_count)?;
85
86    let compressed = compress_typed_ref(&tref_struct)?;
87    let tbuf = decompress_typed_buffer(&compressed)?;
88
89    println!("  Original size: {} bytes ({} structs of {} bytes)",
90             struct_data.len(), struct_count, struct_width);
91    println!("  Compressed size: {} bytes", compressed.len());
92    println!(
93        "  Compression ratio: {:.2}%",
94        (compressed.len() as f64 / struct_data.len() as f64) * 100.0
95    );
96
97    assert_eq!(struct_data.as_slice(), tbuf.as_bytes());
98    println!("  ✓ Round-trip successful!\n");
99
100    println!("All TypedRef compression examples completed successfully!");
101    println!("\nNote: TypedRef provides type information to OpenZL, enabling");
102    println!("type-specific compression optimizations not available with serial compression.");
103
104    Ok(())
105}
Source

pub fn byte_size(&self) -> usize

Get the size of the buffer in bytes

Source

pub fn num_elts(&self) -> usize

Get the number of elements

Examples found in repository?
examples/typed_compression.rs (line 43)
8fn main() -> Result<(), Box<dyn std::error::Error>> {
9    println!("=== TypedRef Compression Examples ===\n");
10
11    // Example 1: Serial (untyped) data
12    println!("Example 1: Serial TypedRef");
13    let text = b"Hello from TypedRef! This is untyped byte data.";
14    let tref_serial = TypedRef::serial(text);
15
16    let compressed = compress_typed_ref(&tref_serial)?;
17    let tbuf = decompress_typed_buffer(&compressed)?;
18
19    println!("  Original size: {} bytes", text.len());
20    println!("  Compressed size: {} bytes", compressed.len());
21    println!("  Data type: {:?}", tbuf.data_type());
22
23    assert_eq!(text.as_slice(), tbuf.as_bytes());
24    println!("  ✓ Round-trip successful!\n");
25
26    // Example 2: Numeric u32 data
27    println!("Example 2: Numeric TypedRef (u32)");
28    let numbers: Vec<u32> = (0..1000).collect();
29    let tref_numeric = TypedRef::numeric(&numbers)?;
30
31    let compressed = compress_typed_ref(&tref_numeric)?;
32    let tbuf = decompress_typed_buffer(&compressed)?;
33
34    let original_size = numbers.len() * std::mem::size_of::<u32>();
35    println!("  Original size: {} bytes ({} elements)", original_size, numbers.len());
36    println!("  Compressed size: {} bytes", compressed.len());
37    println!(
38        "  Compression ratio: {:.2}%",
39        (compressed.len() as f64 / original_size as f64) * 100.0
40    );
41    println!("  Data type: {:?}", tbuf.data_type());
42    println!("  Element width: {} bytes", tbuf.elt_width());
43    println!("  Element count: {}", tbuf.num_elts());
44
45    let decompressed = tbuf.as_numeric::<u32>().expect("Failed to extract u32 data");
46    assert_eq!(numbers.as_slice(), decompressed);
47    println!("  ✓ Round-trip successful!\n");
48
49    // Example 3: Numeric u64 data
50    println!("Example 3: Numeric TypedRef (u64)");
51    let large_numbers: Vec<u64> = (0..500).map(|i| i * 1000000).collect();
52    let tref_numeric = TypedRef::numeric(&large_numbers)?;
53
54    let compressed = compress_typed_ref(&tref_numeric)?;
55    let tbuf = decompress_typed_buffer(&compressed)?;
56
57    let original_size = large_numbers.len() * std::mem::size_of::<u64>();
58    println!("  Original size: {} bytes ({} elements)", original_size, large_numbers.len());
59    println!("  Compressed size: {} bytes", compressed.len());
60    println!(
61        "  Compression ratio: {:.2}%",
62        (compressed.len() as f64 / original_size as f64) * 100.0
63    );
64
65    let decompressed = tbuf.as_numeric::<u64>().expect("Failed to extract u64 data");
66    assert_eq!(large_numbers.as_slice(), decompressed);
67    println!("  ✓ Round-trip successful!\n");
68
69    // Example 4: Struct data
70    println!("Example 4: Struct TypedRef");
71
72    // Simulate a simple struct as raw bytes: [id: u32, value: u32]
73    let struct_width = 8; // 2 * sizeof(u32)
74    let struct_count = 100;
75    let mut struct_data = Vec::with_capacity(struct_width * struct_count);
76
77    for i in 0..struct_count {
78        // Write id (u32)
79        struct_data.extend_from_slice(&(i as u32).to_le_bytes());
80        // Write value (u32)
81        struct_data.extend_from_slice(&((i * 10) as u32).to_le_bytes());
82    }
83
84    let tref_struct = TypedRef::structs(&struct_data, struct_width, struct_count)?;
85
86    let compressed = compress_typed_ref(&tref_struct)?;
87    let tbuf = decompress_typed_buffer(&compressed)?;
88
89    println!("  Original size: {} bytes ({} structs of {} bytes)",
90             struct_data.len(), struct_count, struct_width);
91    println!("  Compressed size: {} bytes", compressed.len());
92    println!(
93        "  Compression ratio: {:.2}%",
94        (compressed.len() as f64 / struct_data.len() as f64) * 100.0
95    );
96
97    assert_eq!(struct_data.as_slice(), tbuf.as_bytes());
98    println!("  ✓ Round-trip successful!\n");
99
100    println!("All TypedRef compression examples completed successfully!");
101    println!("\nNote: TypedRef provides type information to OpenZL, enabling");
102    println!("type-specific compression optimizations not available with serial compression.");
103
104    Ok(())
105}
Source

pub fn elt_width(&self) -> usize

Get the element width in bytes (for struct/numeric types)

Examples found in repository?
examples/typed_compression.rs (line 42)
8fn main() -> Result<(), Box<dyn std::error::Error>> {
9    println!("=== TypedRef Compression Examples ===\n");
10
11    // Example 1: Serial (untyped) data
12    println!("Example 1: Serial TypedRef");
13    let text = b"Hello from TypedRef! This is untyped byte data.";
14    let tref_serial = TypedRef::serial(text);
15
16    let compressed = compress_typed_ref(&tref_serial)?;
17    let tbuf = decompress_typed_buffer(&compressed)?;
18
19    println!("  Original size: {} bytes", text.len());
20    println!("  Compressed size: {} bytes", compressed.len());
21    println!("  Data type: {:?}", tbuf.data_type());
22
23    assert_eq!(text.as_slice(), tbuf.as_bytes());
24    println!("  ✓ Round-trip successful!\n");
25
26    // Example 2: Numeric u32 data
27    println!("Example 2: Numeric TypedRef (u32)");
28    let numbers: Vec<u32> = (0..1000).collect();
29    let tref_numeric = TypedRef::numeric(&numbers)?;
30
31    let compressed = compress_typed_ref(&tref_numeric)?;
32    let tbuf = decompress_typed_buffer(&compressed)?;
33
34    let original_size = numbers.len() * std::mem::size_of::<u32>();
35    println!("  Original size: {} bytes ({} elements)", original_size, numbers.len());
36    println!("  Compressed size: {} bytes", compressed.len());
37    println!(
38        "  Compression ratio: {:.2}%",
39        (compressed.len() as f64 / original_size as f64) * 100.0
40    );
41    println!("  Data type: {:?}", tbuf.data_type());
42    println!("  Element width: {} bytes", tbuf.elt_width());
43    println!("  Element count: {}", tbuf.num_elts());
44
45    let decompressed = tbuf.as_numeric::<u32>().expect("Failed to extract u32 data");
46    assert_eq!(numbers.as_slice(), decompressed);
47    println!("  ✓ Round-trip successful!\n");
48
49    // Example 3: Numeric u64 data
50    println!("Example 3: Numeric TypedRef (u64)");
51    let large_numbers: Vec<u64> = (0..500).map(|i| i * 1000000).collect();
52    let tref_numeric = TypedRef::numeric(&large_numbers)?;
53
54    let compressed = compress_typed_ref(&tref_numeric)?;
55    let tbuf = decompress_typed_buffer(&compressed)?;
56
57    let original_size = large_numbers.len() * std::mem::size_of::<u64>();
58    println!("  Original size: {} bytes ({} elements)", original_size, large_numbers.len());
59    println!("  Compressed size: {} bytes", compressed.len());
60    println!(
61        "  Compression ratio: {:.2}%",
62        (compressed.len() as f64 / original_size as f64) * 100.0
63    );
64
65    let decompressed = tbuf.as_numeric::<u64>().expect("Failed to extract u64 data");
66    assert_eq!(large_numbers.as_slice(), decompressed);
67    println!("  ✓ Round-trip successful!\n");
68
69    // Example 4: Struct data
70    println!("Example 4: Struct TypedRef");
71
72    // Simulate a simple struct as raw bytes: [id: u32, value: u32]
73    let struct_width = 8; // 2 * sizeof(u32)
74    let struct_count = 100;
75    let mut struct_data = Vec::with_capacity(struct_width * struct_count);
76
77    for i in 0..struct_count {
78        // Write id (u32)
79        struct_data.extend_from_slice(&(i as u32).to_le_bytes());
80        // Write value (u32)
81        struct_data.extend_from_slice(&((i * 10) as u32).to_le_bytes());
82    }
83
84    let tref_struct = TypedRef::structs(&struct_data, struct_width, struct_count)?;
85
86    let compressed = compress_typed_ref(&tref_struct)?;
87    let tbuf = decompress_typed_buffer(&compressed)?;
88
89    println!("  Original size: {} bytes ({} structs of {} bytes)",
90             struct_data.len(), struct_count, struct_width);
91    println!("  Compressed size: {} bytes", compressed.len());
92    println!(
93        "  Compression ratio: {:.2}%",
94        (compressed.len() as f64 / struct_data.len() as f64) * 100.0
95    );
96
97    assert_eq!(struct_data.as_slice(), tbuf.as_bytes());
98    println!("  ✓ Round-trip successful!\n");
99
100    println!("All TypedRef compression examples completed successfully!");
101    println!("\nNote: TypedRef provides type information to OpenZL, enabling");
102    println!("type-specific compression optimizations not available with serial compression.");
103
104    Ok(())
105}
Source

pub fn as_bytes(&self) -> &[u8]

Get read-only access to the buffer as bytes

Examples found in repository?
examples/typed_compression.rs (line 23)
8fn main() -> Result<(), Box<dyn std::error::Error>> {
9    println!("=== TypedRef Compression Examples ===\n");
10
11    // Example 1: Serial (untyped) data
12    println!("Example 1: Serial TypedRef");
13    let text = b"Hello from TypedRef! This is untyped byte data.";
14    let tref_serial = TypedRef::serial(text);
15
16    let compressed = compress_typed_ref(&tref_serial)?;
17    let tbuf = decompress_typed_buffer(&compressed)?;
18
19    println!("  Original size: {} bytes", text.len());
20    println!("  Compressed size: {} bytes", compressed.len());
21    println!("  Data type: {:?}", tbuf.data_type());
22
23    assert_eq!(text.as_slice(), tbuf.as_bytes());
24    println!("  ✓ Round-trip successful!\n");
25
26    // Example 2: Numeric u32 data
27    println!("Example 2: Numeric TypedRef (u32)");
28    let numbers: Vec<u32> = (0..1000).collect();
29    let tref_numeric = TypedRef::numeric(&numbers)?;
30
31    let compressed = compress_typed_ref(&tref_numeric)?;
32    let tbuf = decompress_typed_buffer(&compressed)?;
33
34    let original_size = numbers.len() * std::mem::size_of::<u32>();
35    println!("  Original size: {} bytes ({} elements)", original_size, numbers.len());
36    println!("  Compressed size: {} bytes", compressed.len());
37    println!(
38        "  Compression ratio: {:.2}%",
39        (compressed.len() as f64 / original_size as f64) * 100.0
40    );
41    println!("  Data type: {:?}", tbuf.data_type());
42    println!("  Element width: {} bytes", tbuf.elt_width());
43    println!("  Element count: {}", tbuf.num_elts());
44
45    let decompressed = tbuf.as_numeric::<u32>().expect("Failed to extract u32 data");
46    assert_eq!(numbers.as_slice(), decompressed);
47    println!("  ✓ Round-trip successful!\n");
48
49    // Example 3: Numeric u64 data
50    println!("Example 3: Numeric TypedRef (u64)");
51    let large_numbers: Vec<u64> = (0..500).map(|i| i * 1000000).collect();
52    let tref_numeric = TypedRef::numeric(&large_numbers)?;
53
54    let compressed = compress_typed_ref(&tref_numeric)?;
55    let tbuf = decompress_typed_buffer(&compressed)?;
56
57    let original_size = large_numbers.len() * std::mem::size_of::<u64>();
58    println!("  Original size: {} bytes ({} elements)", original_size, large_numbers.len());
59    println!("  Compressed size: {} bytes", compressed.len());
60    println!(
61        "  Compression ratio: {:.2}%",
62        (compressed.len() as f64 / original_size as f64) * 100.0
63    );
64
65    let decompressed = tbuf.as_numeric::<u64>().expect("Failed to extract u64 data");
66    assert_eq!(large_numbers.as_slice(), decompressed);
67    println!("  ✓ Round-trip successful!\n");
68
69    // Example 4: Struct data
70    println!("Example 4: Struct TypedRef");
71
72    // Simulate a simple struct as raw bytes: [id: u32, value: u32]
73    let struct_width = 8; // 2 * sizeof(u32)
74    let struct_count = 100;
75    let mut struct_data = Vec::with_capacity(struct_width * struct_count);
76
77    for i in 0..struct_count {
78        // Write id (u32)
79        struct_data.extend_from_slice(&(i as u32).to_le_bytes());
80        // Write value (u32)
81        struct_data.extend_from_slice(&((i * 10) as u32).to_le_bytes());
82    }
83
84    let tref_struct = TypedRef::structs(&struct_data, struct_width, struct_count)?;
85
86    let compressed = compress_typed_ref(&tref_struct)?;
87    let tbuf = decompress_typed_buffer(&compressed)?;
88
89    println!("  Original size: {} bytes ({} structs of {} bytes)",
90             struct_data.len(), struct_count, struct_width);
91    println!("  Compressed size: {} bytes", compressed.len());
92    println!(
93        "  Compression ratio: {:.2}%",
94        (compressed.len() as f64 / struct_data.len() as f64) * 100.0
95    );
96
97    assert_eq!(struct_data.as_slice(), tbuf.as_bytes());
98    println!("  ✓ Round-trip successful!\n");
99
100    println!("All TypedRef compression examples completed successfully!");
101    println!("\nNote: TypedRef provides type information to OpenZL, enabling");
102    println!("type-specific compression optimizations not available with serial compression.");
103
104    Ok(())
105}
Source

pub fn as_numeric<T: Copy>(&self) -> Option<&[T]>

Get read-only access to numeric data as a typed slice.

Returns None if:

  • The data type is not numeric
  • The element width doesn’t match T’s size
  • The buffer is not properly aligned for T
Examples found in repository?
examples/typed_compression.rs (line 45)
8fn main() -> Result<(), Box<dyn std::error::Error>> {
9    println!("=== TypedRef Compression Examples ===\n");
10
11    // Example 1: Serial (untyped) data
12    println!("Example 1: Serial TypedRef");
13    let text = b"Hello from TypedRef! This is untyped byte data.";
14    let tref_serial = TypedRef::serial(text);
15
16    let compressed = compress_typed_ref(&tref_serial)?;
17    let tbuf = decompress_typed_buffer(&compressed)?;
18
19    println!("  Original size: {} bytes", text.len());
20    println!("  Compressed size: {} bytes", compressed.len());
21    println!("  Data type: {:?}", tbuf.data_type());
22
23    assert_eq!(text.as_slice(), tbuf.as_bytes());
24    println!("  ✓ Round-trip successful!\n");
25
26    // Example 2: Numeric u32 data
27    println!("Example 2: Numeric TypedRef (u32)");
28    let numbers: Vec<u32> = (0..1000).collect();
29    let tref_numeric = TypedRef::numeric(&numbers)?;
30
31    let compressed = compress_typed_ref(&tref_numeric)?;
32    let tbuf = decompress_typed_buffer(&compressed)?;
33
34    let original_size = numbers.len() * std::mem::size_of::<u32>();
35    println!("  Original size: {} bytes ({} elements)", original_size, numbers.len());
36    println!("  Compressed size: {} bytes", compressed.len());
37    println!(
38        "  Compression ratio: {:.2}%",
39        (compressed.len() as f64 / original_size as f64) * 100.0
40    );
41    println!("  Data type: {:?}", tbuf.data_type());
42    println!("  Element width: {} bytes", tbuf.elt_width());
43    println!("  Element count: {}", tbuf.num_elts());
44
45    let decompressed = tbuf.as_numeric::<u32>().expect("Failed to extract u32 data");
46    assert_eq!(numbers.as_slice(), decompressed);
47    println!("  ✓ Round-trip successful!\n");
48
49    // Example 3: Numeric u64 data
50    println!("Example 3: Numeric TypedRef (u64)");
51    let large_numbers: Vec<u64> = (0..500).map(|i| i * 1000000).collect();
52    let tref_numeric = TypedRef::numeric(&large_numbers)?;
53
54    let compressed = compress_typed_ref(&tref_numeric)?;
55    let tbuf = decompress_typed_buffer(&compressed)?;
56
57    let original_size = large_numbers.len() * std::mem::size_of::<u64>();
58    println!("  Original size: {} bytes ({} elements)", original_size, large_numbers.len());
59    println!("  Compressed size: {} bytes", compressed.len());
60    println!(
61        "  Compression ratio: {:.2}%",
62        (compressed.len() as f64 / original_size as f64) * 100.0
63    );
64
65    let decompressed = tbuf.as_numeric::<u64>().expect("Failed to extract u64 data");
66    assert_eq!(large_numbers.as_slice(), decompressed);
67    println!("  ✓ Round-trip successful!\n");
68
69    // Example 4: Struct data
70    println!("Example 4: Struct TypedRef");
71
72    // Simulate a simple struct as raw bytes: [id: u32, value: u32]
73    let struct_width = 8; // 2 * sizeof(u32)
74    let struct_count = 100;
75    let mut struct_data = Vec::with_capacity(struct_width * struct_count);
76
77    for i in 0..struct_count {
78        // Write id (u32)
79        struct_data.extend_from_slice(&(i as u32).to_le_bytes());
80        // Write value (u32)
81        struct_data.extend_from_slice(&((i * 10) as u32).to_le_bytes());
82    }
83
84    let tref_struct = TypedRef::structs(&struct_data, struct_width, struct_count)?;
85
86    let compressed = compress_typed_ref(&tref_struct)?;
87    let tbuf = decompress_typed_buffer(&compressed)?;
88
89    println!("  Original size: {} bytes ({} structs of {} bytes)",
90             struct_data.len(), struct_count, struct_width);
91    println!("  Compressed size: {} bytes", compressed.len());
92    println!(
93        "  Compression ratio: {:.2}%",
94        (compressed.len() as f64 / struct_data.len() as f64) * 100.0
95    );
96
97    assert_eq!(struct_data.as_slice(), tbuf.as_bytes());
98    println!("  ✓ Round-trip successful!\n");
99
100    println!("All TypedRef compression examples completed successfully!");
101    println!("\nNote: TypedRef provides type information to OpenZL, enabling");
102    println!("type-specific compression optimizations not available with serial compression.");
103
104    Ok(())
105}
Source

pub fn string_lens(&self) -> Option<&[u32]>

Get the string lengths array (for string type)

Returns None if the data type is not string

Trait Implementations§

Source§

impl Default for TypedBuffer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for TypedBuffer

Source§

fn drop(&mut self)

Executes the destructor for this type. 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> 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, 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.