pub struct Flag {
pub name: String,
pub type: i32,
pub applies_to: Vec<i32>,
pub allowed_string_values: Vec<String>,
pub min_value: Option<i64>,
pub max_value: Option<i64>,
pub requires_restart: Option<bool>,
pub kind: String,
pub in_beta: Option<bool>,
pub allowed_int_values: Vec<i64>,
}
Expand description
A flag resource.
Fields§
§name: String
This is the name of the flag. Flag names always use underscores, not
hyphens, for example: max_allowed_packet
type: i32
The type of the flag. Flags are typed to being BOOLEAN
, STRING
,
INTEGER
or NONE
. NONE
is used for flags which do not take a
value, such as skip_grant_tables
.
applies_to: Vec<i32>
The database version this flag applies to. Can be
MySQL instances: MYSQL_8_0
, MYSQL_8_0_18
, MYSQL_8_0_26
, MYSQL_5_7
,
or MYSQL_5_6
. PostgreSQL instances: POSTGRES_9_6
, POSTGRES_10
,
POSTGRES_11
or POSTGRES_12
. SQL Server instances:
SQLSERVER_2017_STANDARD
, SQLSERVER_2017_ENTERPRISE
,
SQLSERVER_2017_EXPRESS
, SQLSERVER_2017_WEB
, SQLSERVER_2019_STANDARD
,
SQLSERVER_2019_ENTERPRISE
, SQLSERVER_2019_EXPRESS
, or
SQLSERVER_2019_WEB
.
See the complete
list.
allowed_string_values: Vec<String>
For STRING
flags, a list of strings that the value can be set to.
min_value: Option<i64>
For INTEGER
flags, the minimum allowed value.
max_value: Option<i64>
For INTEGER
flags, the maximum allowed value.
requires_restart: Option<bool>
Indicates whether changing this flag will trigger a database restart. Only applicable to Second Generation instances.
kind: String
This is always sql#flag
.
in_beta: Option<bool>
Whether or not the flag is considered in beta.
allowed_int_values: Vec<i64>
Use this field if only certain integers are accepted. Can be combined with min_value and max_value to add additional values.
Implementations§
source§impl Flag
impl Flag
sourcepub fn type(&self) -> SqlFlagType
pub fn type(&self) -> SqlFlagType
Returns the enum value of type
, or the default if the field is set to an invalid enum value.
sourcepub fn set_type(&mut self, value: SqlFlagType)
pub fn set_type(&mut self, value: SqlFlagType)
Sets type
to the provided enum value.
sourcepub fn applies_to(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<SqlDatabaseVersion>>
pub fn applies_to( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<SqlDatabaseVersion>>
Returns an iterator which yields the valid enum values contained in applies_to
.
sourcepub fn push_applies_to(&mut self, value: SqlDatabaseVersion)
pub fn push_applies_to(&mut self, value: SqlDatabaseVersion)
Appends the provided enum value to applies_to
.
Trait Implementations§
source§impl Message for Flag
impl Message for Flag
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 PartialEq for Flag
impl PartialEq for Flag
impl StructuralPartialEq for Flag
Auto Trait Implementations§
impl Freeze for Flag
impl RefUnwindSafe for Flag
impl Send for Flag
impl Sync for Flag
impl Unpin for Flag
impl UnwindSafe for Flag
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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