pub struct SocketOption {
pub description: String,
pub level: i64,
pub name: i64,
pub state: i32,
pub value: Option<Value>,
}
Expand description
Generic socket option message. This would be used to set socket options that might not exist in upstream kernels or precompiled Envoy binaries.
For example:
.. code-block:: json
{ “description”: “support tcp keep alive”, “state”: 0, “level”: 1, “name”: 9, “int_value”: 1, }
1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux.
With the above configuration, TCP Keep-Alives <<https://www.freesoft.org/CIE/RFC/1122/114.htm>
_>
can be enabled in socket with Linux, which can be used in
:ref:listener's<envoy_v3_api_field_config.listener.v3.Listener.socket_options>
or
:ref:admin's <envoy_v3_api_field_config.bootstrap.v3.Admin.socket_options>
socket_options etc.
It should be noted that the name or level may have different values on different platforms. [#next-free-field: 7]
Fields§
§description: String
An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.
level: i64
Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP
name: i64
The numeric name as passed to setsockopt
state: i32
The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.
value: Option<Value>
Implementations§
Source§impl SocketOption
impl SocketOption
Sourcepub fn state(&self) -> SocketState
pub fn state(&self) -> SocketState
Returns the enum value of state
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_state(&mut self, value: SocketState)
pub fn set_state(&mut self, value: SocketState)
Sets state
to the provided enum value.
Trait Implementations§
Source§impl Clone for SocketOption
impl Clone for SocketOption
Source§fn clone(&self) -> SocketOption
fn clone(&self) -> SocketOption
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SocketOption
impl Debug for SocketOption
Source§impl Default for SocketOption
impl Default for SocketOption
Source§impl Message for SocketOption
impl Message for SocketOption
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl Name for SocketOption
impl Name for SocketOption
Source§const NAME: &'static str = "SocketOption"
const NAME: &'static str = "SocketOption"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.Source§const PACKAGE: &'static str = "envoy.config.core.v3"
const PACKAGE: &'static str = "envoy.config.core.v3"
.
, e.g. google.protobuf
.Source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.Source§impl PartialEq for SocketOption
impl PartialEq for SocketOption
impl StructuralPartialEq for SocketOption
Auto Trait Implementations§
impl Freeze for SocketOption
impl RefUnwindSafe for SocketOption
impl Send for SocketOption
impl Sync for SocketOption
impl Unpin for SocketOption
impl UnwindSafe for SocketOption
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request