pub struct SocketConnection(/* private fields */);
Expand description
A socketConnection inside a SocketConnectionBundle
describes a single connection to a specific client port.
Implementations§
Source§impl SocketConnection
impl SocketConnection
Sourcepub const SD_HEADER_ID: u32 = 4_294_934_784u32
pub const SD_HEADER_ID: u32 = 4_294_934_784u32
The PDU header id for SD messages must always be set to 0xFFFF_8100
Sourcepub fn socket_connection_bundle(
&self,
) -> Result<SocketConnectionBundle, AutosarAbstractionError>
pub fn socket_connection_bundle( &self, ) -> Result<SocketConnectionBundle, AutosarAbstractionError>
get the socket connection bundle containing this socket connection
§Example
let bundle = channel.create_socket_connection_bundle("Bundle", &server_socket)?;
let connection = bundle.create_bundled_connection(&client_socket)?;
assert_eq!(bundle, connection.socket_connection_bundle()?);
Sourcepub fn set_client_port(
&self,
client_port: &SocketAddress,
) -> Result<(), AutosarAbstractionError>
pub fn set_client_port( &self, client_port: &SocketAddress, ) -> Result<(), AutosarAbstractionError>
set the client port of this socket connection
Sourcepub fn client_port(&self) -> Option<SocketAddress>
pub fn client_port(&self) -> Option<SocketAddress>
get the client port of this socket connection
Sourcepub fn create_socket_connection_ipdu_identifier<T: AbstractPdu>(
&self,
pdu: &T,
header_id: u32,
timeout: Option<f64>,
collection_trigger: Option<PduCollectionTrigger>,
) -> Result<(SocketConnectionIpduIdentifier, PduTriggering), AutosarAbstractionError>
pub fn create_socket_connection_ipdu_identifier<T: AbstractPdu>( &self, pdu: &T, header_id: u32, timeout: Option<f64>, collection_trigger: Option<PduCollectionTrigger>, ) -> Result<(SocketConnectionIpduIdentifier, PduTriggering), AutosarAbstractionError>
Create a new SocketConnectionIpduIdentifier
in this socket connection
The SocketConnectionIpduIdentifier
is used to trigger a PDU, and contains associated settings
The function returns a tuple of the new SocketConnectionIpduIdentifier
and the associated PduTriggering
since most callers only need the PduTriggering
.
Sourcepub fn socket_connection_ipdu_identifiers(
&self,
) -> impl Iterator<Item = SocketConnectionIpduIdentifier> + Send + 'static
pub fn socket_connection_ipdu_identifiers( &self, ) -> impl Iterator<Item = SocketConnectionIpduIdentifier> + Send + 'static
create an iterator over all SocketConnectionIpduIdentifiers
in this socket connection
Sourcepub fn pdu_triggerings(
&self,
) -> impl Iterator<Item = PduTriggering> + Send + 'static
pub fn pdu_triggerings( &self, ) -> impl Iterator<Item = PduTriggering> + Send + 'static
create an iterator over all PDU triggerings in this socket connection
Sourcepub fn set_client_ip_addr_from_connection_request(
&self,
value: Option<bool>,
) -> Result<(), AutosarAbstractionError>
pub fn set_client_ip_addr_from_connection_request( &self, value: Option<bool>, ) -> Result<(), AutosarAbstractionError>
set or remove the client_ip_addr_from_connection_request
attribute for this socket connection
if the value is Some(true), the attribute is set to “true” if the value is Some(false), the attribute is set to “false” if the value is None, the attribute is removed
Sourcepub fn client_ip_addr_from_connection_request(&self) -> Option<bool>
pub fn client_ip_addr_from_connection_request(&self) -> Option<bool>
get the value of the client_ip_addr_from_connection_request
attribute for this socket connection
Sourcepub fn set_client_port_from_connection_request(
&self,
value: Option<bool>,
) -> Result<(), AutosarAbstractionError>
pub fn set_client_port_from_connection_request( &self, value: Option<bool>, ) -> Result<(), AutosarAbstractionError>
set or remove the client_port_from_connection_request
attribute for this socket connection
if the value is Some(true), the attribute is set to “true” if the value is Some(false), the attribute is set to “false” if the value is None, the attribute is removed
Sourcepub fn client_port_from_connection_request(&self) -> Option<bool>
pub fn client_port_from_connection_request(&self) -> Option<bool>
get the value of the client_port_from_connection_request
attribute for this socket connection
Sourcepub fn set_runtime_ip_address_configuration(
&self,
state: bool,
) -> Result<(), AutosarAbstractionError>
pub fn set_runtime_ip_address_configuration( &self, state: bool, ) -> Result<(), AutosarAbstractionError>
set the RuntimeIpAddressConfiguration
attribute for this socket connection
If state
is true, the attribute is set to “Sd”
If state
is false, the attribute is removed
Sourcepub fn runtime_ip_address_configuration(&self) -> bool
pub fn runtime_ip_address_configuration(&self) -> bool
check if the value of the RuntimeIpAddressConfiguration
attribute is “SD”
Sourcepub fn set_runtime_port_configuration(
&self,
state: bool,
) -> Result<(), AutosarAbstractionError>
pub fn set_runtime_port_configuration( &self, state: bool, ) -> Result<(), AutosarAbstractionError>
set the RuntimePortConfiguration
attributes for this socket connection
If state
is true, the attribute is set to “Sd”
If state
is false, the attributes is removed
Sourcepub fn runtime_port_configuration(&self) -> bool
pub fn runtime_port_configuration(&self) -> bool
check if the value of the RuntimePortConfiguration
attribute is “SD”
Trait Implementations§
Source§impl Clone for SocketConnection
impl Clone for SocketConnection
Source§fn clone(&self) -> SocketConnection
fn clone(&self) -> SocketConnection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SocketConnection
impl Debug for SocketConnection
Source§impl From<SocketConnection> for Element
impl From<SocketConnection> for Element
Source§fn from(val: SocketConnection) -> Self
fn from(val: SocketConnection) -> Self
Source§impl Hash for SocketConnection
impl Hash for SocketConnection
Source§impl PartialEq for SocketConnection
impl PartialEq for SocketConnection
Source§impl TryFrom<Element> for SocketConnection
impl TryFrom<Element> for SocketConnection
impl Eq for SocketConnection
impl StructuralPartialEq for SocketConnection
Auto Trait Implementations§
impl Freeze for SocketConnection
impl !RefUnwindSafe for SocketConnection
impl Send for SocketConnection
impl Sync for SocketConnection
impl Unpin for SocketConnection
impl !UnwindSafe for SocketConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.