Struct SocketConnection

Source
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

Source

pub const SD_HEADER_ID: u32 = 4_294_934_784u32

The PDU header id for SD messages must always be set to 0xFFFF_8100

Source

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()?);
Source

pub fn set_client_port( &self, client_port: &SocketAddress, ) -> Result<(), AutosarAbstractionError>

set the client port of this socket connection

Source

pub fn client_port(&self) -> Option<SocketAddress>

get the client port of this socket connection

Source

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.

Source

pub fn socket_connection_ipdu_identifiers( &self, ) -> impl Iterator<Item = SocketConnectionIpduIdentifier> + Send + 'static

create an iterator over all SocketConnectionIpduIdentifiers in this socket connection

Source

pub fn pdu_triggerings( &self, ) -> impl Iterator<Item = PduTriggering> + Send + 'static

create an iterator over all PDU triggerings in this socket connection

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn runtime_ip_address_configuration(&self) -> bool

check if the value of the RuntimeIpAddressConfiguration attribute is “SD”

Source

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

Source

pub fn runtime_port_configuration(&self) -> bool

check if the value of the RuntimePortConfiguration attribute is “SD”

Trait Implementations§

Source§

impl AbstractionElement for SocketConnection

Source§

fn element(&self) -> &Element

Get the underlying Element from the abstraction element
Source§

impl Clone for SocketConnection

Source§

fn clone(&self) -> SocketConnection

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 Debug for SocketConnection

Source§

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

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

impl From<SocketConnection> for Element

Source§

fn from(val: SocketConnection) -> Self

Converts to this type from the input type.
Source§

impl Hash for SocketConnection

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SocketConnection

Source§

fn eq(&self, other: &SocketConnection) -> 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 TryFrom<Element> for SocketConnection

Source§

type Error = AutosarAbstractionError

The type returned in the event of a conversion error.
Source§

fn try_from(element: Element) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Eq for SocketConnection

Source§

impl StructuralPartialEq for SocketConnection

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> 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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, 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.