NumericId

Struct NumericId 

Source
pub struct NumericId(/* private fields */);
Expand description

Base type for numeric dial-in identifieirs

For now, this type checks via its FromStr implementation that the value is valid, e.g. when deserializing through serde.

When loading from the database through diesel, no validation is performed in the current implementation.

Implementations§

Source§

impl NumericId

Source

pub fn generate() -> Self

Generate a new random NumericId

Trait Implementations§

Source§

impl<'__expr> AsExpression<Nullable<Text>> for &'__expr NumericId

Source§

type Expression = Bound<Nullable<Text>, &'__expr NumericId>

The expression being returned
Source§

fn as_expression(self) -> <Self as AsExpression<Nullable<Text>>>::Expression

Perform the conversion
Source§

impl AsExpression<Nullable<Text>> for NumericId

Source§

type Expression = Bound<Nullable<Text>, NumericId>

The expression being returned
Source§

fn as_expression(self) -> <Self as AsExpression<Nullable<Text>>>::Expression

Perform the conversion
Source§

impl<'__expr> AsExpression<Text> for &'__expr NumericId

Source§

type Expression = Bound<Text, &'__expr NumericId>

The expression being returned
Source§

fn as_expression(self) -> <Self as AsExpression<Text>>::Expression

Perform the conversion
Source§

impl AsExpression<Text> for NumericId

Source§

type Expression = Bound<Text, NumericId>

The expression being returned
Source§

fn as_expression(self) -> <Self as AsExpression<Text>>::Expression

Perform the conversion
Source§

impl AsRef<NumericId> for CallInId

Source§

fn as_ref(&self) -> &NumericId

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NumericId> for CallInPassword

Source§

fn as_ref(&self) -> &NumericId

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<String> for NumericId

Source§

fn as_ref(&self) -> &String

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for NumericId

Source§

fn clone(&self) -> NumericId

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 NumericId

Source§

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

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

impl<'de> Deserialize<'de> for NumericId
where Self: FromStr, <Self as FromStr>::Err: Display,

Source§

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 Display for NumericId

Source§

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

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

impl ExampleData for NumericId

Source§

fn example_data() -> Self

Get an example instance of the current datatype.
Source§

impl From<CallInId> for NumericId

Source§

fn from(value: CallInId) -> Self

Converts to this type from the input type.
Source§

impl From<CallInPassword> for NumericId

Source§

fn from(value: CallInPassword) -> Self

Converts to this type from the input type.
Source§

impl From<NumericId> for CallInId

Source§

fn from(value: NumericId) -> Self

Converts to this type from the input type.
Source§

impl From<NumericId> for CallInPassword

Source§

fn from(value: NumericId) -> Self

Converts to this type from the input type.
Source§

impl From<NumericId> for String

Source§

fn from(value: NumericId) -> Self

Converts to this type from the input type.
Source§

impl FromRedisValue for NumericId

Source§

fn from_redis_value(v: Value) -> Result<Self, ParsingError>

Given a redis Value this attempts to convert it into the given destination type. If that fails because it’s not compatible an appropriate error is generated.
Source§

fn from_redis_value_ref(v: &Value) -> Result<Self, ParsingError>

Given a redis Value this attempts to convert it into the given destination type. If that fails because it’s not compatible an appropriate error is generated.
Source§

fn from_redis_value_refs(items: &[Value]) -> Result<Vec<Self>, ParsingError>

Similar to from_redis_value_ref but constructs a vector of objects from another vector of values. This primarily exists internally to customize the behavior for vectors of tuples.
Source§

fn from_redis_values(items: Vec<Value>) -> Result<Vec<Self>, ParsingError>

The same as from_redis_value_refs, but takes a Vec<Value> instead of a &[Value].
Source§

fn from_each_redis_values(items: Vec<Value>) -> Vec<Result<Self, ParsingError>>

The same as from_redis_values, but returns a result for each conversion to make handling them case-by-case possible.
Source§

fn from_byte_slice(_vec: &[u8]) -> Option<Vec<Self>>

Convert bytes to a single element vector.
Source§

fn from_byte_vec(_vec: Vec<u8>) -> Result<Vec<Self>, ParsingError>

Convert bytes to a single element vector.
Source§

impl<DB> FromSql<Text, DB> for NumericId
where DB: Backend, String: FromSql<Text, DB>,

Source§

fn from_sql(raw: RawValue<'_, DB>) -> Result<Self>

See the trait documentation.
Source§

fn from_nullable_sql(raw: Option<RawValue<'_, DB>>) -> Result<Self>

A specialized variant of from_sql for handling null values. Read more
Source§

impl FromStr for NumericId

Source§

type Err = ParseNumericIdError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for NumericId

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 Ord for NumericId

Source§

fn cmp(&self, other: &NumericId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for NumericId

Source§

fn eq(&self, other: &NumericId) -> 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 PartialOrd for NumericId

Source§

fn partial_cmp(&self, other: &NumericId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialSchema for NumericId

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<__DB, __ST> Queryable<__ST, __DB> for NumericId
where __DB: Backend, __ST: SingleValue, Self: FromSql<__ST, __DB>,

Source§

type Row = NumericId

The Rust type you’d like to map from. Read more
Source§

fn build(row: Self) -> Result<Self>

Construct an instance of this type
Source§

impl Serialize for NumericId

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToRedisArgs for NumericId

Source§

fn write_redis_args<W>(&self, out: &mut W)
where W: ?Sized + RedisWrite,

This writes the value into a vector of bytes. Each item is a single argument. Most items generate a single item. Read more
Source§

fn to_redis_args(&self) -> Vec<Vec<u8>>

This converts the value into a vector of bytes. Each item is a single argument. Most items generate a vector of a single item. Read more
Source§

fn describe_numeric_behavior(&self) -> NumericBehavior

Returns an information about the contained value with regards to it’s numeric behavior in a redis context. This is used in some high level concepts to switch between different implementations of redis functions (for instance INCR vs INCRBYFLOAT).
Source§

fn num_of_args(&self) -> usize

Returns the number of arguments this value will generate. Read more
Source§

impl ToSchema for NumericId

Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more
Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

impl<__DB> ToSql<Nullable<Text>, __DB> for NumericId
where __DB: Backend, Self: ToSql<Text, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

See the trait documentation.
Source§

impl<DB> ToSql<Text, DB> for NumericId
where DB: Backend, String: ToSql<Text, DB>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

See the trait documentation.
Source§

impl DieselNewtype<Text> for NumericId

Source§

impl Eq for NumericId

Source§

impl StructuralPartialEq for NumericId

Source§

impl ToSingleRedisArg for NumericId

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AggregateExpressionMethods for T

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
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> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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, ST, DB> FromSqlRow<ST, DB> for T
where T: Queryable<ST, DB>, ST: SqlTypeOrSelectable, DB: Backend, <T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,

Source§

fn build_from_row<'a>( row: &impl Row<'a, DB>, ) -> Result<T, Box<dyn Error + Sync + Send>>

See the trait documentation.
Source§

impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
where DB: Backend, T: FromSql<ST, DB>, ST: SingleValue,

Source§

fn build_from_row<'a>( row: &impl Row<'a, DB>, ) -> Result<T, Box<dyn Error + Sync + Send>>

See the trait documentation
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<I> IntoResettable<String> for I
where I: Into<String>,

Source§

fn into_resettable(self) -> Resettable<String>

Convert to the intended resettable type
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
where ST: SqlTypeOrSelectable + TupleSize, T: Queryable<ST, DB>, DB: Backend,

Source§

const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE

The number of fields that this type will consume.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,