Struct PpsDevice

Source
pub struct PpsDevice(/* private fields */);

Implementations§

Source§

impl PpsDevice

Source

pub fn new(path: PathBuf) -> Result<PpsDevice>

Examples found in repository?
examples/non_blocking.rs (line 18)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/non_blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_non_blocking().expect("Could not fetch!");
43        println!("{:#?}", data);
44    }
45}
More examples
Hide additional examples
examples/timeout.rs (line 18)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/timeout /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_timeout(0, 500_000_000);
43        println!("{:#?}", data); // half of these should be timeouts for 1PPS devices
44    }
45}
examples/blocking.rs (line 18)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    if capabilities & pps::PPS_CANWAIT == 0 {
42        println!("Cannot CANWAIT");
43        return;
44    }
45
46    loop {
47        let data = pps.fetch_blocking().expect("Could not fetch!");
48        println!("{:#?}", data);
49    }
50}
Source

pub fn get_params(&self) -> Result<pps_kparams>

Examples found in repository?
examples/non_blocking.rs (line 23)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/non_blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_non_blocking().expect("Could not fetch!");
43        println!("{:#?}", data);
44    }
45}
More examples
Hide additional examples
examples/timeout.rs (line 23)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/timeout /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_timeout(0, 500_000_000);
43        println!("{:#?}", data); // half of these should be timeouts for 1PPS devices
44    }
45}
examples/blocking.rs (line 23)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    if capabilities & pps::PPS_CANWAIT == 0 {
42        println!("Cannot CANWAIT");
43        return;
44    }
45
46    loop {
47        let data = pps.fetch_blocking().expect("Could not fetch!");
48        println!("{:#?}", data);
49    }
50}
Source

pub fn set_params(&self, params: &mut pps_kparams) -> Result<()>

Examples found in repository?
examples/non_blocking.rs (line 39)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/non_blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_non_blocking().expect("Could not fetch!");
43        println!("{:#?}", data);
44    }
45}
More examples
Hide additional examples
examples/timeout.rs (line 39)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/timeout /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_timeout(0, 500_000_000);
43        println!("{:#?}", data); // half of these should be timeouts for 1PPS devices
44    }
45}
examples/blocking.rs (line 39)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    if capabilities & pps::PPS_CANWAIT == 0 {
42        println!("Cannot CANWAIT");
43        return;
44    }
45
46    loop {
47        let data = pps.fetch_blocking().expect("Could not fetch!");
48        println!("{:#?}", data);
49    }
50}
Source

pub fn get_cap(&self) -> Result<c_uint>

Examples found in repository?
examples/non_blocking.rs (line 20)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/non_blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_non_blocking().expect("Could not fetch!");
43        println!("{:#?}", data);
44    }
45}
More examples
Hide additional examples
examples/timeout.rs (line 20)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/timeout /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_timeout(0, 500_000_000);
43        println!("{:#?}", data); // half of these should be timeouts for 1PPS devices
44    }
45}
examples/blocking.rs (line 20)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    if capabilities & pps::PPS_CANWAIT == 0 {
42        println!("Cannot CANWAIT");
43        return;
44    }
45
46    loop {
47        let data = pps.fetch_blocking().expect("Could not fetch!");
48        println!("{:#?}", data);
49    }
50}
Source

pub fn fetch_blocking(&self) -> Result<pps_fdata>

Fetch next PPS event, blocking until it arrives

Device must support PPS_CANWAIT, otherwise it will give an EOPNOTSUPP error

Examples found in repository?
examples/blocking.rs (line 47)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    if capabilities & pps::PPS_CANWAIT == 0 {
42        println!("Cannot CANWAIT");
43        return;
44    }
45
46    loop {
47        let data = pps.fetch_blocking().expect("Could not fetch!");
48        println!("{:#?}", data);
49    }
50}
Source

pub fn fetch_timeout(&self, seconds: i64, nanoseconds: i32) -> Result<pps_fdata>

Fetch next PPS event with a timeout, giving an ETIMEDOUT error if event does not come in time

Device must support PPS_CANWAIT, otherwise it will give an EOPNOTSUPP error

Examples found in repository?
examples/timeout.rs (line 42)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/timeout /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_timeout(0, 500_000_000);
43        println!("{:#?}", data); // half of these should be timeouts for 1PPS devices
44    }
45}
Source

pub fn fetch_non_blocking(&self) -> Result<pps_fdata>

Fetch newest PPS event without blocking

Examples found in repository?
examples/non_blocking.rs (line 42)
7fn main() {
8    let args: Vec<String> = std::env::args().collect();
9    if args.len() < 2 {
10        println!("Example usage:");
11        println!("$ sudo ./target/debug/examples/non_blocking /dev/pps0");
12        return;
13    }
14
15    let path = PathBuf::from(&args[1]); // path to PPS device
16
17    println!("Opening PPS device {}", path.display());
18    let pps = PpsDevice::new(path).expect("Could not open file!");
19
20    let capabilities = pps.get_cap().expect("Could not get capabilities!");
21    println!("Capabilities: {:#x}", capabilities);
22
23    let mut params = pps.get_params().expect("Could not get params!");
24    println!("{:?}", params);
25
26    // Turn on CAPTUREASSERT if available
27    if capabilities & pps::PPS_CAPTUREASSERT != 0 {
28        params.mode |= pps::PPS_CAPTUREASSERT as i32;
29    } else {
30        println!("Cannot CAPTUREASSERT");
31    }
32    // Turn on CAPTURECLEAR if available
33    if capabilities & pps::PPS_CAPTURECLEAR != 0 {
34        params.mode |= pps::PPS_CAPTURECLEAR as i32;
35    } else {
36        println!("Cannot CAPTURECLEAR");
37    }
38
39    pps.set_params(&mut params).expect("Could not set params!");
40
41    loop {
42        let data = pps.fetch_non_blocking().expect("Could not fetch!");
43        println!("{:#?}", data);
44    }
45}

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.