pub struct Feature {
pub id: u16,
pub project_id: u16,
pub name: String,
pub variants: Vec<Variant>,
pub value_type: FeatureValueType,
pub is_enabled: bool,
}
Fields§
§id: u16
§project_id: u16
§name: String
§variants: Vec<Variant>
§value_type: FeatureValueType
§is_enabled: bool
Implementations§
Source§impl Feature
impl Feature
pub fn get_default_variant(&self) -> Option<&Variant>
pub fn get_default_value(&self) -> Option<FeatureValue>
pub fn with_variants(self, variants: Vec<Variant>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Feature
impl<'de> Deserialize<'de> for Feature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Feature> for FeatureRequestPayload
impl From<Feature> for FeatureRequestPayload
Source§impl<'a, R: Row> FromRow<'a, R> for Featurewhere
&'a str: ColumnIndex<R>,
u16: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
Vec<Variant>: Decode<'a, R::Database> + Type<R::Database>,
FeatureValueType: Decode<'a, R::Database> + Type<R::Database>,
bool: Decode<'a, R::Database> + Type<R::Database>,
impl<'a, R: Row> FromRow<'a, R> for Featurewhere
&'a str: ColumnIndex<R>,
u16: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
Vec<Variant>: Decode<'a, R::Database> + Type<R::Database>,
FeatureValueType: Decode<'a, R::Database> + Type<R::Database>,
bool: Decode<'a, R::Database> + Type<R::Database>,
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
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
Mutably borrows from an owned value. Read more
Source§impl<T> FromJsonReader for Twhere
T: DeserializeOwned + Validate,
impl<T> FromJsonReader for Twhere
T: DeserializeOwned + Validate,
Source§impl<'de, T> FromJsonSlice<'de> for Twhere
T: Deserialize<'de> + Validate,
impl<'de, T> FromJsonSlice<'de> for Twhere
T: Deserialize<'de> + Validate,
Source§impl<'de, T> FromJsonStr<'de> for Twhere
T: Deserialize<'de> + Validate,
impl<'de, T> FromJsonStr<'de> for Twhere
T: Deserialize<'de> + Validate,
Source§impl<T> FromJsonValue for Twhere
T: DeserializeOwned + Validate,
impl<T> FromJsonValue for Twhere
T: DeserializeOwned + Validate,
Source§fn from_json_value(value: Value) -> Result<T, Error<Error>>
fn from_json_value(value: Value) -> Result<T, Error<Error>>
Convert from
serde_json::Value
. Read moreSource§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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more