Skip to main content

NativeConnection

Struct NativeConnection 

Source
pub struct NativeConnection {
    pub fd: i32,
    pub write_fd: i32,
    pub close_fds: bool,
    pub transport_type: NativeTransportType,
    pub peer_info: Option<String>,
    pub local_info: Option<String>,
    stream: Option<NativeConnectionStream>,
}
Expand description

Native connection wrapper used by the runtime for TCP and Unix transports.

§Fields

  • fd: Stored field on NativeConnection.
  • write_fd: Stored field on NativeConnection.
  • close_fds: Stored field on NativeConnection.
  • transport_type: Stored field on NativeConnection.
  • peer_info: Stored field on NativeConnection.
  • local_info: Stored field on NativeConnection.

§Examples

ⓘ
let _ = std::mem::size_of::<pharos_runtime_core::connection::NativeConnection>();

Fields§

§fd: i32§write_fd: i32§close_fds: bool§transport_type: NativeTransportType§peer_info: Option<String>§local_info: Option<String>§stream: Option<NativeConnectionStream>

Implementations§

Source§

impl NativeConnection

Source

pub fn metadata_only( transport_type: NativeTransportType, peer_info: Option<String>, local_info: Option<String>, ) -> Self

Performs metadata only.

§Parameters
  • transport_type: Input consumed by [crate::connection::metadata_only].
  • peer_info: Input consumed by [crate::connection::metadata_only].
  • local_info: Input consumed by [crate::connection::metadata_only].
§Returns

Returns the computed value produced by [crate::connection::metadata_only].

§Examples
ⓘ
let _result = pharos_runtime_core::connection::metadata_only(todo!(), todo!(), todo!());
Source

pub fn from_tcp_stream(stream: TcpStream) -> Self

Performs from TCP stream.

§Parameters
  • stream: Input consumed by [crate::connection::from_tcp_stream].
§Returns

Returns the computed value produced by [crate::connection::from_tcp_stream].

§Examples
ⓘ
let _result = pharos_runtime_core::connection::from_tcp_stream(todo!());
Source

pub fn from_unix_stream(stream: UnixStream) -> Self

Wraps a Unix-domain stream in a NativeConnection.

§Parameters
  • stream: Input consumed by [crate::connection::from_unix_stream].
§Returns

Returns the computed value produced by [crate::connection::from_unix_stream].

§Examples
ⓘ
let _result = pharos_runtime_core::connection::from_unix_stream(todo!());

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> Same for T

Source§

type Output = T

Should always be Self
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.