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).unwrap();
let connection = bundle.create_bundled_connection(&client_socket).unwrap();
assert_eq!(bundle, connection.socket_connection_bundle().unwrap());Sourcepub fn client_port(&self) -> Option<SocketAddress>
pub fn client_port(&self) -> Option<SocketAddress>
get the client port of this socket connection
Sourcepub fn trigger_pdu<T: AbstractPdu>(
&self,
pdu: &T,
header_id: u32,
timeout: Option<f64>,
collection_trigger: Option<PduCollectionTrigger>,
) -> Result<PduTriggering, AutosarAbstractionError>
pub fn trigger_pdu<T: AbstractPdu>( &self, pdu: &T, header_id: u32, timeout: Option<f64>, collection_trigger: Option<PduCollectionTrigger>, ) -> Result<PduTriggering, AutosarAbstractionError>
add a PDU to the socket connection, returning a PduTriggering
Sourcepub fn set_header_id(
&self,
pdu_triggering: &PduTriggering,
header_id: u64,
) -> Result<(), AutosarAbstractionError>
pub fn set_header_id( &self, pdu_triggering: &PduTriggering, header_id: u64, ) -> Result<(), AutosarAbstractionError>
set the header id for a PDU in this socket connection
Sourcepub fn header_id(&self, pdu_triggering: &PduTriggering) -> Option<u64>
pub fn header_id(&self, pdu_triggering: &PduTriggering) -> Option<u64>
get the header id for a PDU in this socket connection
Sourcepub fn set_timeout(
&self,
pdu_triggering: &PduTriggering,
timeout: f64,
) -> Result<(), AutosarAbstractionError>
pub fn set_timeout( &self, pdu_triggering: &PduTriggering, timeout: f64, ) -> Result<(), AutosarAbstractionError>
set the timeout for a PDU in this socket connection
Sourcepub fn timeout(&self, pdu_triggering: &PduTriggering) -> Option<f64>
pub fn timeout(&self, pdu_triggering: &PduTriggering) -> Option<f64>
get the timeout for a PDU in this socket connection
Sourcepub fn set_collection_trigger(
&self,
pdu_triggering: &PduTriggering,
trigger: PduCollectionTrigger,
) -> Result<(), AutosarAbstractionError>
pub fn set_collection_trigger( &self, pdu_triggering: &PduTriggering, trigger: PduCollectionTrigger, ) -> Result<(), AutosarAbstractionError>
set the collection trigger for a PDU in this socket connection
Sourcepub fn collection_trigger(
&self,
pdu_triggering: &PduTriggering,
) -> Option<PduCollectionTrigger>
pub fn collection_trigger( &self, pdu_triggering: &PduTriggering, ) -> Option<PduCollectionTrigger>
get the collection trigger for a PDU in this socket connection
Sourcepub fn add_routing_group(
&self,
pdu_triggering: &PduTriggering,
routing_group: &SoAdRoutingGroup,
) -> Result<(), AutosarAbstractionError>
pub fn add_routing_group( &self, pdu_triggering: &PduTriggering, routing_group: &SoAdRoutingGroup, ) -> Result<(), AutosarAbstractionError>
add a SoAdRoutingGroup for a PDU in this socket connection
Sourcepub fn pdu_triggerings(&self) -> impl Iterator<Item = PduTriggering>
pub fn pdu_triggerings(&self) -> impl Iterator<Item = PduTriggering>
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_address_configuration(
&self,
state: bool,
) -> Result<(), AutosarAbstractionError>
pub fn set_runtime_address_configuration( &self, state: bool, ) -> Result<(), AutosarAbstractionError>
set or remove the RuntimeIpAddressConfiguration/RuntimePortConfiguration attributes for this socket connection
If state is true, the attributes are set to “Sd”
If state is false, the attributes are removed
Sourcepub fn runtime_ip_address_configuration(&self) -> bool
pub fn runtime_ip_address_configuration(&self) -> bool
get the value of the RuntimeIpAddressConfiguration attribute for this socket connection
Sourcepub fn runtime_port_configuration(&self) -> bool
pub fn runtime_port_configuration(&self) -> bool
get the value of the RuntimePortConfiguration attribute for this socket connection
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.