Skip to main content

GenericMessage

Struct GenericMessage 

Source
pub struct GenericMessage<H, B> {
    pub service: ServiceId,
    pub method: MethodId,
    pub header: H,
    pub body: B,
}
Expand description

Message addressed to a service instance.

This is used to identify the contents of the payload so that it can be correctly serialized.

Has room for a header to include additional information about the body of the message.

§Notes

This is the generic implementation. You probably want to use Message<T> instead.

Fields§

§service: ServiceId

Identifier of the service interface.

§method: MethodId

Identifier of the method or event.

§header: H

Additional information about the message.

§body: B

Contents of the message.

Implementations§

Source§

impl<H, B> GenericMessage<H, B>

Source

pub const fn new(header: H, body: B) -> Self

Creates a new GenericMessage<H, B>.

§Examples
use rsomeip_proto::GenericMessage;

let message = GenericMessage::new("header", "body");
assert_eq!(message.header, "header");
assert_eq!(message.body, "body");
Source

pub const fn id(&self) -> MessageId

Returns the MessageId portion of this message.

§Examples
use rsomeip_proto::{GenericMessage, ServiceId, MethodId};

let message = GenericMessage::new("header", "body")
    .with_service(ServiceId::new(0x1234))
    .with_method(MethodId::new(0x5678));
assert_eq!(message.id().as_u32(), 0x1234_5678);
Source

pub const fn with_id(self, id: MessageId) -> Self

Returns self with the given MessageId.

§Examples
use rsomeip_proto::{GenericMessage, MessageId};

let message = GenericMessage::new("header", "body").with_id(MessageId::from(0x1234_5678));
assert_eq!(message.service.as_u16(), 0x1234);
assert_eq!(message.method.as_u16(), 0x5678);
Source

pub const fn with_service(self, service: ServiceId) -> Self

Returns self with the given ServiceId.

§Examples
use rsomeip_proto::{GenericMessage, ServiceId};

let message = GenericMessage::new("header", "body").with_service(ServiceId::new(0x1234));
assert_eq!(message.service.as_u16(), 0x1234);
Examples found in repository?
examples/request-sample.rs (line 33)
29fn send_requests(socket: &UdpSocket, endpoint: &Endpoint) {
30    // Create a request to send to the service provider.
31    let mut session_id = SessionId::ENABLED;
32    let request = Message::default()
33        .with_service(SAMPLE_SERVICE_ID)
34        .with_method(SAMPLE_METHOD_ID)
35        .with_client(ClientId::new(0x0001))
36        .with_body((0..10).collect::<Vec<u8>>());
37
38    // Continuously send requests to the service provider.
39    loop {
40        // Clone the request and increment the session id.
41        let request = request.clone().with_session(session_id.increment());
42        println!("> {request} {:02x?}", request.body);
43
44        // Process the request into bytes.
45        let mut buffer = BytesMut::with_capacity(request.size_hint());
46        endpoint
47            .process(request, &mut buffer)
48            .expect("should process the request");
49
50        // Send the data through the socket.
51        socket
52            .send_to(&buffer.freeze(), stub_address())
53            .expect("should send the data.");
54
55        // Wait for a response.
56        let mut buffer = BytesMut::zeroed(64);
57        let (size, _) = socket
58            .recv_from(&mut buffer[..])
59            .expect("should receive the data");
60
61        // Process the response.
62        let response: Message = endpoint
63            .poll(&mut buffer.split_to(size).freeze())
64            .expect("should process the response");
65        println!("< {response} {:02x?}", response.body);
66
67        // Wait before sending another request.
68        std::thread::sleep(std::time::Duration::from_secs(1));
69    }
70}
Source

pub const fn with_method(self, method: MethodId) -> Self

Returns self with the given MethodId.

§Examples
use rsomeip_proto::{GenericMessage, MethodId};

let message = GenericMessage::new("header", "body").with_method(MethodId::new(0x1234));
assert_eq!(message.method.as_u16(), 0x1234);
Examples found in repository?
examples/request-sample.rs (line 34)
29fn send_requests(socket: &UdpSocket, endpoint: &Endpoint) {
30    // Create a request to send to the service provider.
31    let mut session_id = SessionId::ENABLED;
32    let request = Message::default()
33        .with_service(SAMPLE_SERVICE_ID)
34        .with_method(SAMPLE_METHOD_ID)
35        .with_client(ClientId::new(0x0001))
36        .with_body((0..10).collect::<Vec<u8>>());
37
38    // Continuously send requests to the service provider.
39    loop {
40        // Clone the request and increment the session id.
41        let request = request.clone().with_session(session_id.increment());
42        println!("> {request} {:02x?}", request.body);
43
44        // Process the request into bytes.
45        let mut buffer = BytesMut::with_capacity(request.size_hint());
46        endpoint
47            .process(request, &mut buffer)
48            .expect("should process the request");
49
50        // Send the data through the socket.
51        socket
52            .send_to(&buffer.freeze(), stub_address())
53            .expect("should send the data.");
54
55        // Wait for a response.
56        let mut buffer = BytesMut::zeroed(64);
57        let (size, _) = socket
58            .recv_from(&mut buffer[..])
59            .expect("should receive the data");
60
61        // Process the response.
62        let response: Message = endpoint
63            .poll(&mut buffer.split_to(size).freeze())
64            .expect("should process the response");
65        println!("< {response} {:02x?}", response.body);
66
67        // Wait before sending another request.
68        std::thread::sleep(std::time::Duration::from_secs(1));
69    }
70}
Source

pub fn with_header<T>(self, header: T) -> GenericMessage<T, B>

Maps a GenericMessage<H, B> to a GenericMessage<T, B> by replacing the header of the message with the given value.

§Examples
use rsomeip_proto::GenericMessage;

let message = GenericMessage::new("header", "body").with_header(0x1234_u16);
assert_eq!(message.header, 0x1234_u16);
Source

pub fn with_body<T>(self, body: T) -> GenericMessage<H, T>

Maps a GenericMessage<H, B> to a GenericMessage<H, T> by replacing the body of the message with the given value.

§Examples
use rsomeip_proto::GenericMessage;

let message = GenericMessage::new("header", "body").with_body(0x1234_u16);
assert_eq!(message.body, 0x1234_u16);
Examples found in repository?
examples/request-sample.rs (line 36)
29fn send_requests(socket: &UdpSocket, endpoint: &Endpoint) {
30    // Create a request to send to the service provider.
31    let mut session_id = SessionId::ENABLED;
32    let request = Message::default()
33        .with_service(SAMPLE_SERVICE_ID)
34        .with_method(SAMPLE_METHOD_ID)
35        .with_client(ClientId::new(0x0001))
36        .with_body((0..10).collect::<Vec<u8>>());
37
38    // Continuously send requests to the service provider.
39    loop {
40        // Clone the request and increment the session id.
41        let request = request.clone().with_session(session_id.increment());
42        println!("> {request} {:02x?}", request.body);
43
44        // Process the request into bytes.
45        let mut buffer = BytesMut::with_capacity(request.size_hint());
46        endpoint
47            .process(request, &mut buffer)
48            .expect("should process the request");
49
50        // Send the data through the socket.
51        socket
52            .send_to(&buffer.freeze(), stub_address())
53            .expect("should send the data.");
54
55        // Wait for a response.
56        let mut buffer = BytesMut::zeroed(64);
57        let (size, _) = socket
58            .recv_from(&mut buffer[..])
59            .expect("should receive the data");
60
61        // Process the response.
62        let response: Message = endpoint
63            .poll(&mut buffer.split_to(size).freeze())
64            .expect("should process the response");
65        println!("< {response} {:02x?}", response.body);
66
67        // Wait before sending another request.
68        std::thread::sleep(std::time::Duration::from_secs(1));
69    }
70}
Source

pub fn map<T, U, F>(self, f: F) -> GenericMessage<T, U>
where F: FnOnce(H, B) -> (T, U),

Maps a GenericMessage<H, B> to a GenericMessage<T, U> by applying a function to the header and body of the message.

§Examples
use rsomeip_proto::GenericMessage;

let message = GenericMessage::new(1u8, 2u8)
    .map(|header, body| (header + 1, body + 1));
assert_eq!(message.header, 2);
assert_eq!(message.body, 3);
Source

pub fn map_header<T, F>(self, f: F) -> GenericMessage<T, B>
where F: FnOnce(H) -> T,

Maps a GenericMessage<H, B> to a GenericMessage<T, B> by applying a function to the header of the message.

§Examples
use rsomeip_proto::GenericMessage;

let message = GenericMessage::new(1u8, "body").map_header(|header| header + 1);
assert_eq!(message.header, 2);
Source

pub fn map_body<T, F>(self, f: F) -> GenericMessage<H, T>
where F: FnOnce(B) -> T,

Maps a GenericMessage<H, B> to a GenericMessage<H, T> by applying a function to the body of the message.

§Examples
use rsomeip_proto::GenericMessage;

let message = GenericMessage::new("header", 2u8).map_body(|body| body + 1);
assert_eq!(message.body, 3);
Source

pub const fn replace_header(&mut self, value: H) -> H

Replaces the header of the message with the given value.

Returns the old value.

§Examples
use rsomeip_proto::GenericMessage;

let mut message = GenericMessage::new("header", "body");
assert_eq!(message.replace_header("new_header"), "header");
assert_eq!(message.header, "new_header");
Source

pub const fn replace_body(&mut self, value: B) -> B

Replaces the body of the message with the given value.

Returns the old value.

§Examples
use rsomeip_proto::GenericMessage;

let mut message = GenericMessage::new("header", "body");
assert_eq!(message.replace_body("new_body"), "body");
assert_eq!(message.body, "new_body");
Source§

impl<B> GenericMessage<Header, B>

Specialization for the Header type.

Source

pub fn into_response(self, return_code: ReturnCode) -> Self

Returns self as a response message with the given return_code.

§Examples
use rsomeip_proto::{GenericMessage, Header, MessageType, ReturnCode};

let message = GenericMessage::new(Header::new(), "body")
    .into_response(ReturnCode::NotOk);
assert_eq!(message.header.message_type.as_type(), MessageType::Response);
assert_eq!(message.header.return_code, ReturnCode::NotOk);
assert_eq!(message.body, "body");
Source

pub fn into_error(self, return_code: ReturnCode) -> Self

Returns self as an error message with the given return_code.

§Examples
use rsomeip_proto::{GenericMessage, Header, MessageType, ReturnCode};

let message = GenericMessage::new(Header::new(), "body")
    .into_error(ReturnCode::NotOk);
assert_eq!(message.header.message_type.as_type(), MessageType::Error);
assert_eq!(message.header.return_code, ReturnCode::NotOk);
assert_eq!(message.body, "body");
Source

pub const fn client(&self) -> ClientId

Returns the ClientId portion of the Header.

§Examples
use rsomeip_proto::{GenericMessage, Header, ClientId};

let message = GenericMessage::new(Header::new(), "body")
    .with_client(ClientId::new(0x1234));
assert_eq!(message.client().as_u16(), 0x1234);
Source

pub const fn with_client(self, client: ClientId) -> Self

Returns self with the given ClientId.

§Examples
use rsomeip_proto::{GenericMessage, Header, ClientId};

let message = GenericMessage::new(Header::new(), "body")
    .with_client(ClientId::new(0x1234));
assert_eq!(message.client().as_u16(), 0x1234);
Examples found in repository?
examples/request-sample.rs (line 35)
29fn send_requests(socket: &UdpSocket, endpoint: &Endpoint) {
30    // Create a request to send to the service provider.
31    let mut session_id = SessionId::ENABLED;
32    let request = Message::default()
33        .with_service(SAMPLE_SERVICE_ID)
34        .with_method(SAMPLE_METHOD_ID)
35        .with_client(ClientId::new(0x0001))
36        .with_body((0..10).collect::<Vec<u8>>());
37
38    // Continuously send requests to the service provider.
39    loop {
40        // Clone the request and increment the session id.
41        let request = request.clone().with_session(session_id.increment());
42        println!("> {request} {:02x?}", request.body);
43
44        // Process the request into bytes.
45        let mut buffer = BytesMut::with_capacity(request.size_hint());
46        endpoint
47            .process(request, &mut buffer)
48            .expect("should process the request");
49
50        // Send the data through the socket.
51        socket
52            .send_to(&buffer.freeze(), stub_address())
53            .expect("should send the data.");
54
55        // Wait for a response.
56        let mut buffer = BytesMut::zeroed(64);
57        let (size, _) = socket
58            .recv_from(&mut buffer[..])
59            .expect("should receive the data");
60
61        // Process the response.
62        let response: Message = endpoint
63            .poll(&mut buffer.split_to(size).freeze())
64            .expect("should process the response");
65        println!("< {response} {:02x?}", response.body);
66
67        // Wait before sending another request.
68        std::thread::sleep(std::time::Duration::from_secs(1));
69    }
70}
Source

pub const fn session(&self) -> SessionId

Returns the SessionId portion of the Header.

§Examples
use rsomeip_proto::{GenericMessage, Header, SessionId};

let message = GenericMessage::new(Header::new(), "body")
    .with_session(SessionId::new(0x1234));
assert_eq!(message.session().as_u16(), 0x1234);
Source

pub const fn with_session(self, session: SessionId) -> Self

Returns self with the given SessionId.

§Examples
use rsomeip_proto::{GenericMessage, Header, SessionId};

let message = GenericMessage::new(Header::new(), "body")
    .with_session(SessionId::new(0x1234));
assert_eq!(message.session().as_u16(), 0x1234);
Examples found in repository?
examples/request-sample.rs (line 41)
29fn send_requests(socket: &UdpSocket, endpoint: &Endpoint) {
30    // Create a request to send to the service provider.
31    let mut session_id = SessionId::ENABLED;
32    let request = Message::default()
33        .with_service(SAMPLE_SERVICE_ID)
34        .with_method(SAMPLE_METHOD_ID)
35        .with_client(ClientId::new(0x0001))
36        .with_body((0..10).collect::<Vec<u8>>());
37
38    // Continuously send requests to the service provider.
39    loop {
40        // Clone the request and increment the session id.
41        let request = request.clone().with_session(session_id.increment());
42        println!("> {request} {:02x?}", request.body);
43
44        // Process the request into bytes.
45        let mut buffer = BytesMut::with_capacity(request.size_hint());
46        endpoint
47            .process(request, &mut buffer)
48            .expect("should process the request");
49
50        // Send the data through the socket.
51        socket
52            .send_to(&buffer.freeze(), stub_address())
53            .expect("should send the data.");
54
55        // Wait for a response.
56        let mut buffer = BytesMut::zeroed(64);
57        let (size, _) = socket
58            .recv_from(&mut buffer[..])
59            .expect("should receive the data");
60
61        // Process the response.
62        let response: Message = endpoint
63            .poll(&mut buffer.split_to(size).freeze())
64            .expect("should process the response");
65        println!("< {response} {:02x?}", response.body);
66
67        // Wait before sending another request.
68        std::thread::sleep(std::time::Duration::from_secs(1));
69    }
70}
Source

pub const fn protocol(&self) -> ProtocolVersion

Returns the ProtocolVersion portion of the Header.

§Examples
use rsomeip_proto::{GenericMessage, Header, ProtocolVersion};

let message = GenericMessage::new(Header::new(), "body")
    .with_protocol(ProtocolVersion::new(0x12));
assert_eq!(message.protocol().as_u8(), 0x12);
Source

pub const fn with_protocol(self, protocol: ProtocolVersion) -> Self

Returns self with the given ProtocolVersion.

§Examples
use rsomeip_proto::{GenericMessage, Header, ProtocolVersion};

let message = GenericMessage::new(Header::new(), "body")
    .with_protocol(ProtocolVersion::new(0x12));
assert_eq!(message.protocol().as_u8(), 0x12);
Source

pub const fn interface(&self) -> InterfaceVersion

Returns the InterfaceVersion portion of the Header.

§Examples
use rsomeip_proto::{GenericMessage, Header, InterfaceVersion};

let message = GenericMessage::new(Header::new(), "body")
    .with_interface(InterfaceVersion::new(0x12));
assert_eq!(message.interface().as_u8(), 0x12);
Source

pub const fn with_interface(self, interface: InterfaceVersion) -> Self

Returns self with the given InterfaceVersion.

§Examples
use rsomeip_proto::{GenericMessage, Header, InterfaceVersion};

let message = GenericMessage::new(Header::new(), "body")
    .with_interface(InterfaceVersion::new(0x12));
assert_eq!(message.interface().as_u8(), 0x12);
Source

pub const fn message_type(&self) -> MessageType

Returns the MessageType of this GenericMessage<Header, B>.

§Examples
use rsomeip_proto::{GenericMessage, Header, MessageType};

let message = GenericMessage::new(Header::new(), "body")
    .with_message_type(MessageType::Notification);
assert_eq!(message.message_type(), MessageType::Notification);
Source

pub const fn with_message_type(self, message_type: MessageType) -> Self

Returns self with the given MessageType.

§Examples
use rsomeip_proto::{GenericMessage, Header, MessageType};

let message = GenericMessage::new(Header::new(), "body")
    .with_message_type(MessageType::Notification);
assert_eq!(message.message_type(), MessageType::Notification);
Examples found in repository?
examples/response-sample.rs (line 45)
29fn send_responses(socket: &UdpSocket, endpoint: &Endpoint) {
30    // Continuously process requests from service consumers.
31    loop {
32        // Wait for a request.
33        let mut buffer = BytesMut::zeroed(64);
34        let (size, remote_address) = socket
35            .recv_from(&mut buffer[..])
36            .expect("should receive the data");
37
38        // Process the request.
39        let request: Message = endpoint
40            .poll(&mut buffer.split_to(size).freeze())
41            .expect("should process the request");
42        println!("< {request} {:02x?}", request.body);
43
44        // Create a response.
45        let response = request.clone().with_message_type(MessageType::Response);
46        println!("> {response} {:02x?}", response.body);
47
48        // Process the response into bytes.
49        let mut buffer = BytesMut::with_capacity(request.size_hint());
50        endpoint
51            .process(response, &mut buffer)
52            .expect("should process the response");
53
54        // Send the data through the socket.
55        socket
56            .send_to(&buffer.freeze(), remote_address)
57            .expect("should send the data.");
58    }
59}
Source

pub const fn return_code(&self) -> ReturnCode

Returns the ReturnCode portion of the Header.

§Examples
use rsomeip_proto::{GenericMessage, Header, ReturnCode};

let message = GenericMessage::new(Header::new(), "body")
    .with_return_code(ReturnCode::E2e);
assert_eq!(message.return_code(), ReturnCode::E2e);
Source

pub const fn with_return_code(self, return_code: ReturnCode) -> Self

Returns self with the given ReturnCode.

§Examples
use rsomeip_proto::{GenericMessage, Header, ReturnCode};

let message = GenericMessage::new(Header::new(), "body")
    .with_return_code(ReturnCode::E2e);
assert_eq!(message.return_code(), ReturnCode::E2e);
Source§

impl<H, B> GenericMessage<H, B>
where H: Serialize + Deserialize<Output = H>, B: Serialize + Deserialize<Output = B>,

Source

pub fn to_bytes(&self) -> Result<Bytes, SerializeError>

Returns a buffer containing the serialized message.

§Errors

Returns a SerializeError if the message could not be serialized.

Source

pub fn from_bytes(buffer: &mut impl Buf) -> Result<Self, DeserializeError>

Returns a GenericMessage<H, B> deserialized from the buffer.

§Errors

Returns a DeserializeError if the message could not be deserialized.

Trait Implementations§

Source§

impl<H: Clone, B: Clone> Clone for GenericMessage<H, B>

Source§

fn clone(&self) -> GenericMessage<H, B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H: Debug, B: Debug> Debug for GenericMessage<H, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<H, B> Default for GenericMessage<H, B>
where H: Default, B: Default,

Source§

fn default() -> Self

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

impl<H, B> Deserialize for GenericMessage<H, B>
where H: Deserialize<Output = H>, B: Deserialize<Output = B>,

Source§

type Output = GenericMessage<H, B>

Type of the data that will be deserialized.
Source§

fn deserialize(buffer: &mut impl Buf) -> Result<Self::Output, DeserializeError>

Deserializes an instance of Deserialize::Output from the buffer. Read more
Source§

fn deserialize_len( length: LengthField, buffer: &mut impl Buf, ) -> Result<Self::Output, DeserializeError>

Deserializes an instance of Deserialize::Output from the buffer. Read more
Source§

impl<H, B> Display for GenericMessage<H, B>
where H: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats self into a string.

§Examples
use rsomeip_proto::{GenericMessage, ServiceId, MethodId};

let message = GenericMessage::new("header", "body")
    .with_service(ServiceId::new(0x1234))
    .with_method(MethodId::new(0x5678));
assert_eq!(message.to_string(), "1234.5678.header")
Source§

impl<H: PartialEq, B: PartialEq> PartialEq for GenericMessage<H, B>

Source§

fn eq(&self, other: &GenericMessage<H, B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<H, B> Serialize for GenericMessage<H, B>
where H: Serialize, B: Serialize,

Source§

fn serialize(&self, buffer: &mut impl BufMut) -> Result<usize, SerializeError>

Serializes the implementing type into the buffer. Read more
Source§

fn size_hint(&self) -> usize

Returns the expected length of the serialized data. Read more
Source§

fn serialize_len( &self, length: LengthField, buffer: &mut impl BufMut, ) -> Result<usize, SerializeError>

Serializes the implementing type into the buffer. Read more
Source§

impl<H: Eq, B: Eq> Eq for GenericMessage<H, B>

Source§

impl<H, B> StructuralPartialEq for GenericMessage<H, B>

Auto Trait Implementations§

§

impl<H, B> Freeze for GenericMessage<H, B>
where H: Freeze, B: Freeze,

§

impl<H, B> RefUnwindSafe for GenericMessage<H, B>

§

impl<H, B> Send for GenericMessage<H, B>
where H: Send, B: Send,

§

impl<H, B> Sync for GenericMessage<H, B>
where H: Sync, B: Sync,

§

impl<H, B> Unpin for GenericMessage<H, B>
where H: Unpin, B: Unpin,

§

impl<H, B> UnsafeUnpin for GenericMessage<H, B>
where H: UnsafeUnpin, B: UnsafeUnpin,

§

impl<H, B> UnwindSafe for GenericMessage<H, B>
where H: UnwindSafe, B: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.