Struct SctpStream

Source
pub struct SctpStream(/* private fields */);
Expand description

One-to-one SCTP connected stream which behaves like a TCP stream. A SctpStream can be obtained either actively by connecting to a SCTP endpoint with the connect constructor, or passively from a SctpListener which accepts new connections

Implementations§

Source§

impl SctpStream

Source

pub fn connect<A: ToSocketAddrs>(address: A) -> Result<SctpStream>

Create a new stream by connecting it to a remote endpoint

Examples found in repository?
examples/stream.rs (line 8)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn connectx<A: ToSocketAddrs>(addresses: &[A]) -> Result<SctpStream>

Create a new stream by connecting it to a remote endpoint having multiple addresses

Source

pub fn sendmsg(&self, msg: &[u8], stream: u16) -> Result<usize>

Send bytes on the specified SCTP stream. On success, returns the quantity of bytes read

Examples found in repository?
examples/listener.rs (line 19)
4fn main() {
5    match SctpListener::bind("0.0.0.0:3868") {
6        //	match SctpListener::bindx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
7        Ok(serv) => {
8            println!("bound to {:?}", serv.local_addrs().unwrap());
9            //			serv.set_timeout(5).unwrap();
10            match serv.accept() {
11                Err(e) => println!("{:?}", e.kind()),
12                Ok((peer, _)) => {
13                    println!(
14                        "connection from {:?} on {:?}",
15                        peer.peer_addrs().unwrap(),
16                        peer.local_addrs().unwrap()
17                    );
18                    // Send message on stream 6
19                    peer.sendmsg("foobar\n".as_bytes(), 6).unwrap();
20                    let mut reply = [0u8; 1024];
21                    let (len, stream) = peer.recvmsg(&mut reply).unwrap();
22                    println!("Received {} bytes on stream {}", len, stream);
23                }
24            };
25        }
26        Err(e) => panic!("{:?}", e.kind()),
27    }
28}
More examples
Hide additional examples
examples/stream.rs (line 32)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn sendmsg_ppid(&self, msg: &[u8], ppid: u32, stream: u16) -> Result<usize>

Send bytes on the specified SCTP stream. On success, returns the quantity of bytes read

Source

pub fn recvmsg(&self, msg: &mut [u8]) -> Result<(usize, u16)>

Read bytes. On success, return a tuple with the quantity of bytes received and the stream they were recived on

Examples found in repository?
examples/listener.rs (line 21)
4fn main() {
5    match SctpListener::bind("0.0.0.0:3868") {
6        //	match SctpListener::bindx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
7        Ok(serv) => {
8            println!("bound to {:?}", serv.local_addrs().unwrap());
9            //			serv.set_timeout(5).unwrap();
10            match serv.accept() {
11                Err(e) => println!("{:?}", e.kind()),
12                Ok((peer, _)) => {
13                    println!(
14                        "connection from {:?} on {:?}",
15                        peer.peer_addrs().unwrap(),
16                        peer.local_addrs().unwrap()
17                    );
18                    // Send message on stream 6
19                    peer.sendmsg("foobar\n".as_bytes(), 6).unwrap();
20                    let mut reply = [0u8; 1024];
21                    let (len, stream) = peer.recvmsg(&mut reply).unwrap();
22                    println!("Received {} bytes on stream {}", len, stream);
23                }
24            };
25        }
26        Err(e) => panic!("{:?}", e.kind()),
27    }
28}
More examples
Hide additional examples
examples/stream.rs (line 38)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn local_addrs(&self) -> Result<Vec<SocketAddr>>

Return the list of local socket addresses for this stream

Examples found in repository?
examples/listener.rs (line 16)
4fn main() {
5    match SctpListener::bind("0.0.0.0:3868") {
6        //	match SctpListener::bindx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
7        Ok(serv) => {
8            println!("bound to {:?}", serv.local_addrs().unwrap());
9            //			serv.set_timeout(5).unwrap();
10            match serv.accept() {
11                Err(e) => println!("{:?}", e.kind()),
12                Ok((peer, _)) => {
13                    println!(
14                        "connection from {:?} on {:?}",
15                        peer.peer_addrs().unwrap(),
16                        peer.local_addrs().unwrap()
17                    );
18                    // Send message on stream 6
19                    peer.sendmsg("foobar\n".as_bytes(), 6).unwrap();
20                    let mut reply = [0u8; 1024];
21                    let (len, stream) = peer.recvmsg(&mut reply).unwrap();
22                    println!("Received {} bytes on stream {}", len, stream);
23                }
24            };
25        }
26        Err(e) => panic!("{:?}", e.kind()),
27    }
28}
Source

pub fn peer_addrs(&self) -> Result<Vec<SocketAddr>>

Return the list of socket addresses for the peer this stream is connected to

Examples found in repository?
examples/listener.rs (line 15)
4fn main() {
5    match SctpListener::bind("0.0.0.0:3868") {
6        //	match SctpListener::bindx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
7        Ok(serv) => {
8            println!("bound to {:?}", serv.local_addrs().unwrap());
9            //			serv.set_timeout(5).unwrap();
10            match serv.accept() {
11                Err(e) => println!("{:?}", e.kind()),
12                Ok((peer, _)) => {
13                    println!(
14                        "connection from {:?} on {:?}",
15                        peer.peer_addrs().unwrap(),
16                        peer.local_addrs().unwrap()
17                    );
18                    // Send message on stream 6
19                    peer.sendmsg("foobar\n".as_bytes(), 6).unwrap();
20                    let mut reply = [0u8; 1024];
21                    let (len, stream) = peer.recvmsg(&mut reply).unwrap();
22                    println!("Received {} bytes on stream {}", len, stream);
23                }
24            };
25        }
26        Err(e) => panic!("{:?}", e.kind()),
27    }
28}
Source

pub fn shutdown(&self, how: Shutdown) -> Result<()>

Shuts down the read, write, or both halves of this connection

Source

pub fn set_nodelay(&self, nodelay: bool) -> Result<()>

Set or unset SCTP_NODELAY option

Examples found in repository?
examples/stream.rs (line 14)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn has_nodelay(&self) -> Result<bool>

Verify if SCTP_NODELAY option is activated for this socket

Examples found in repository?
examples/stream.rs (line 13)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn set_buffer_size(&self, dir: SoDirection, size: usize) -> Result<()>

Set the socket buffer size for the direction specified by dir. Linux systems will double the provided size

Examples found in repository?
examples/stream.rs (line 19)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn get_buffer_size(&self, dir: SoDirection) -> Result<usize>

Get the socket buffer size for the direction specified by dir

Examples found in repository?
examples/stream.rs (line 18)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn set_timeout(&self, dir: SoDirection, timeout: i32) -> Result<()>

Set timeout in seconds for operation dir (either receive or send)

Examples found in repository?
examples/stream.rs (line 27)
6fn main() {
7    // Create a new one-to-one stream
8    match SctpStream::connect("127.0.0.1:3868") {
9        //	match SctpStream::connectx(&["10.0.2.15:3868", "127.0.0.1:3868"]) {
10        Err(e) => println!("{:?}", e.kind()),
11        Ok(mut peer) => {
12            // Set SCTP no delay
13            println!("{}", peer.has_nodelay().unwrap());
14            peer.set_nodelay(true).unwrap();
15            println!("{}", peer.has_nodelay().unwrap());
16
17            // Set socket send buffer size
18            let oldsize = peer.get_buffer_size(SoDirection::Send).unwrap();
19            peer.set_buffer_size(SoDirection::Send, 4096).unwrap();
20            println!(
21                "Set send buffer size to {} (was : {})",
22                peer.get_buffer_size(SoDirection::Send).unwrap(),
23                oldsize
24            );
25
26            println!("Setting read timeout to 10 s");
27            peer.set_timeout(SoDirection::Receive, 10).unwrap();
28
29            // Write a message using the io::Write trait
30            peer.write_all("foo bar\n".as_bytes()).unwrap();
31            // Write a message on stream 6
32            peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
33            let mut data = [0u8; 1024];
34            // Read data using the io::Read trait
35            peer.read_exact(&mut data).unwrap();
36            // Read data using SCTP advanced feature, and retrieve the stream id
37            // on which data were received
38            let (size, stream) = peer.recvmsg(&mut data).unwrap();
39            println!("Received {} bytes on stream {}", size, stream);
40        }
41    }
42}
Source

pub fn try_clone(&self) -> Result<SctpStream>

Try to clone the SctpStream. On success, returns a new stream wrapping a new socket handler

Trait Implementations§

Source§

impl AsRawFd for SctpStream

Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl FromRawFd for SctpStream

Source§

unsafe fn from_raw_fd(fd: RawFd) -> SctpStream

Constructs a new instance of Self from the given raw file descriptor. Read more
Source§

impl Read for SctpStream

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
1.36.0 · Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored implementation. Read more
1.0.0 · Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
1.0.0 · Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self>
where Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where R: Read, Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more
Source§

impl Write for SctpStream

Source§

fn write(&mut self, buf: &[u8]) -> Result<usize>

Writes a buffer into this writer, returning how many bytes were written. Read more
Source§

fn flush(&mut self) -> Result<()>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
1.36.0 · Source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
Source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
1.0.0 · Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Write. 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.