pub struct Timestamp {
pub seconds: i64,
pub nanos: i32,
}Expand description
A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution.
The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.
All minutes are 60 seconds long. Leap seconds are “smeared” so that no leap second table is needed for interpretation, using a 24-hour linear smear.
The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.
§Examples
Example 1: Compute Timestamp from POSIX time().
Timestamp timestamp;
timestamp.set_seconds(time(NULL));
timestamp.set_nanos(0);Example 2: Compute Timestamp from POSIX gettimeofday().
struct timeval tv;
gettimeofday(&tv, NULL);
Timestamp timestamp;
timestamp.set_seconds(tv.tv_sec);
timestamp.set_nanos(tv.tv_usec * 1000);Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime().
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
Timestamp timestamp;
timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));Example 4: Compute Timestamp from Java System.currentTimeMillis().
long millis = System.currentTimeMillis();
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
.setNanos((int) ((millis % 1000) * 1000000)).build();Example 5: Compute Timestamp from Java Instant.now().
Instant now = Instant.now();
Timestamp timestamp =
Timestamp.newBuilder().setSeconds(now.getEpochSecond())
.setNanos(now.getNano()).build();Example 6: Compute Timestamp from current time in Python.
timestamp = Timestamp()
timestamp.GetCurrentTime()§JSON Mapping
In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by “Z”) when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset).
For example, “2017-01-15T01:30:15.01Z” encodes 15.01 seconds past 01:30 UTC on January 15, 2017.
In JavaScript, one can convert a Date object to this format using the
standard
toISOString()
method. In Python, a standard datetime.datetime object can be converted
to this format using
strftime with
the time format spec ‘%Y-%m-%dT%H:%M:%S.%fZ’. Likewise, in Java, one can use
the Joda Time’s ISODateTimeFormat.dateTime() to obtain a formatter capable of generating timestamps in this format.
Fields§
§seconds: i64Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
nanos: i32Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn format(&self, string: &str) -> Result<String, TimestampError>
Available on crate feature chrono only.
pub fn format(&self, string: &str) -> Result<String, TimestampError>
chrono only.Converts this timestamp into a chrono::DateTime<Utc> struct and calls .format on it with the string argument being given.
Sourcepub fn as_datetime_utc(&self) -> Result<DateTime<Utc>, TimestampError>
Available on crate feature chrono only.
pub fn as_datetime_utc(&self) -> Result<DateTime<Utc>, TimestampError>
chrono only.Converts this Timestamp instance to chrono::DateTime with chrono::Utc.
Source§impl Timestamp
impl Timestamp
Sourcepub fn is_within_range_from_now(&self, range: Duration) -> bool
Available on crate features std or chrono-wasm only.
pub fn is_within_range_from_now(&self, range: Duration) -> bool
std or chrono-wasm only.Checks whether the Timestamp instance is within the indicated range (positive or negative) from now.
Sourcepub fn is_within_future_range(&self, range: Duration) -> bool
Available on crate features std or chrono-wasm only.
pub fn is_within_future_range(&self, range: Duration) -> bool
std or chrono-wasm only.Checks whether the Timestamp instance is within the indicated range in the future.
Sourcepub fn is_within_past_range(&self, range: Duration) -> bool
Available on crate features std or chrono-wasm only.
pub fn is_within_past_range(&self, range: Duration) -> bool
std or chrono-wasm only.Checks whether the Timestamp instance is within the indicated range in the past.
Source§impl Timestamp
impl Timestamp
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Normalizes the timestamp to a canonical format.
Based on google::protobuf::util::CreateNormalized.
Sourcepub fn try_normalize(self) -> Result<Self, Self>
pub fn try_normalize(self) -> Result<Self, Self>
Normalizes the timestamp to a canonical format, returning the original value if it cannot be normalized.
Normalization is based on google::protobuf::util::CreateNormalized.
Sourcepub fn normalized(&self) -> Self
pub fn normalized(&self) -> Self
Return a normalized copy of the timestamp to a canonical format.
Based on google::protobuf::util::CreateNormalized.
Sourcepub fn date(year: i64, month: u8, day: u8) -> Result<Self, TimestampError>
pub fn date(year: i64, month: u8, day: u8) -> Result<Self, TimestampError>
Creates a new Timestamp at the start of the provided UTC date.
Trait Implementations§
Source§impl<'__expr> AsExpression<Datetime> for &'__expr Timestamp
impl<'__expr> AsExpression<Datetime> for &'__expr Timestamp
Source§type Expression = Bound<Datetime, &'__expr Timestamp>
type Expression = Bound<Datetime, &'__expr Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<Datetime>>::Expression
fn as_expression(self) -> <Self as AsExpression<Datetime>>::Expression
Source§impl AsExpression<Datetime> for Timestamp
impl AsExpression<Datetime> for Timestamp
Source§type Expression = Bound<Datetime, Timestamp>
type Expression = Bound<Datetime, Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<Datetime>>::Expression
fn as_expression(self) -> <Self as AsExpression<Datetime>>::Expression
Source§impl<'__expr> AsExpression<Nullable<Datetime>> for &'__expr Timestamp
impl<'__expr> AsExpression<Nullable<Datetime>> for &'__expr Timestamp
Source§fn as_expression(self) -> <Self as AsExpression<Nullable<Datetime>>>::Expression
fn as_expression(self) -> <Self as AsExpression<Nullable<Datetime>>>::Expression
Source§impl AsExpression<Nullable<Datetime>> for Timestamp
impl AsExpression<Nullable<Datetime>> for Timestamp
Source§fn as_expression(self) -> <Self as AsExpression<Nullable<Datetime>>>::Expression
fn as_expression(self) -> <Self as AsExpression<Nullable<Datetime>>>::Expression
Source§impl<'__expr> AsExpression<Nullable<Timestamp>> for &'__expr Timestamp
impl<'__expr> AsExpression<Nullable<Timestamp>> for &'__expr Timestamp
Source§type Expression = Bound<Nullable<Timestamp>, &'__expr Timestamp>
type Expression = Bound<Nullable<Timestamp>, &'__expr Timestamp>
Source§fn as_expression(
self,
) -> <Self as AsExpression<Nullable<Timestamp>>>::Expression
fn as_expression( self, ) -> <Self as AsExpression<Nullable<Timestamp>>>::Expression
Source§impl AsExpression<Nullable<Timestamp>> for Timestamp
impl AsExpression<Nullable<Timestamp>> for Timestamp
Source§fn as_expression(
self,
) -> <Self as AsExpression<Nullable<Timestamp>>>::Expression
fn as_expression( self, ) -> <Self as AsExpression<Nullable<Timestamp>>>::Expression
Source§impl<'__expr> AsExpression<Nullable<Timestamptz>> for &'__expr Timestamp
impl<'__expr> AsExpression<Nullable<Timestamptz>> for &'__expr Timestamp
Source§type Expression = Bound<Nullable<Timestamptz>, &'__expr Timestamp>
type Expression = Bound<Nullable<Timestamptz>, &'__expr Timestamp>
Source§fn as_expression(
self,
) -> <Self as AsExpression<Nullable<Timestamptz>>>::Expression
fn as_expression( self, ) -> <Self as AsExpression<Nullable<Timestamptz>>>::Expression
Source§impl AsExpression<Nullable<Timestamptz>> for Timestamp
impl AsExpression<Nullable<Timestamptz>> for Timestamp
Source§type Expression = Bound<Nullable<Timestamptz>, Timestamp>
type Expression = Bound<Nullable<Timestamptz>, Timestamp>
Source§fn as_expression(
self,
) -> <Self as AsExpression<Nullable<Timestamptz>>>::Expression
fn as_expression( self, ) -> <Self as AsExpression<Nullable<Timestamptz>>>::Expression
Source§impl<'__expr> AsExpression<Nullable<Timestamptz>> for &'__expr Timestamp
impl<'__expr> AsExpression<Nullable<Timestamptz>> for &'__expr Timestamp
Source§type Expression = Bound<Nullable<Timestamptz>, &'__expr Timestamp>
type Expression = Bound<Nullable<Timestamptz>, &'__expr Timestamp>
Source§fn as_expression(
self,
) -> <Self as AsExpression<Nullable<TimestamptzSqlite>>>::Expression
fn as_expression( self, ) -> <Self as AsExpression<Nullable<TimestamptzSqlite>>>::Expression
Source§impl AsExpression<Nullable<Timestamptz>> for Timestamp
impl AsExpression<Nullable<Timestamptz>> for Timestamp
Source§type Expression = Bound<Nullable<Timestamptz>, Timestamp>
type Expression = Bound<Nullable<Timestamptz>, Timestamp>
Source§fn as_expression(
self,
) -> <Self as AsExpression<Nullable<TimestamptzSqlite>>>::Expression
fn as_expression( self, ) -> <Self as AsExpression<Nullable<TimestamptzSqlite>>>::Expression
Source§impl<'__expr> AsExpression<Timestamp> for &'__expr Timestamp
impl<'__expr> AsExpression<Timestamp> for &'__expr Timestamp
Source§type Expression = Bound<Timestamp, &'__expr Timestamp>
type Expression = Bound<Timestamp, &'__expr Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<Timestamp>>::Expression
fn as_expression(self) -> <Self as AsExpression<Timestamp>>::Expression
Source§impl AsExpression<Timestamp> for Timestamp
impl AsExpression<Timestamp> for Timestamp
Source§type Expression = Bound<Timestamp, Timestamp>
type Expression = Bound<Timestamp, Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<Timestamp>>::Expression
fn as_expression(self) -> <Self as AsExpression<Timestamp>>::Expression
Source§impl<'__expr> AsExpression<Timestamptz> for &'__expr Timestamp
impl<'__expr> AsExpression<Timestamptz> for &'__expr Timestamp
Source§type Expression = Bound<Timestamptz, &'__expr Timestamp>
type Expression = Bound<Timestamptz, &'__expr Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<Timestamptz>>::Expression
fn as_expression(self) -> <Self as AsExpression<Timestamptz>>::Expression
Source§impl AsExpression<Timestamptz> for Timestamp
impl AsExpression<Timestamptz> for Timestamp
Source§type Expression = Bound<Timestamptz, Timestamp>
type Expression = Bound<Timestamptz, Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<Timestamptz>>::Expression
fn as_expression(self) -> <Self as AsExpression<Timestamptz>>::Expression
Source§impl<'__expr> AsExpression<Timestamptz> for &'__expr Timestamp
impl<'__expr> AsExpression<Timestamptz> for &'__expr Timestamp
Source§type Expression = Bound<Timestamptz, &'__expr Timestamp>
type Expression = Bound<Timestamptz, &'__expr Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<TimestamptzSqlite>>::Expression
fn as_expression(self) -> <Self as AsExpression<TimestamptzSqlite>>::Expression
Source§impl AsExpression<Timestamptz> for Timestamp
impl AsExpression<Timestamptz> for Timestamp
Source§type Expression = Bound<Timestamptz, Timestamp>
type Expression = Bound<Timestamptz, Timestamp>
Source§fn as_expression(self) -> <Self as AsExpression<TimestamptzSqlite>>::Expression
fn as_expression(self) -> <Self as AsExpression<TimestamptzSqlite>>::Expression
Source§impl<'de> Deserialize<'de> for Timestamp
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Timestamp
serde only.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>,
Source§impl From<NaiveDateTime> for Timestamp
Available on crate feature chrono only.
impl From<NaiveDateTime> for Timestamp
chrono only.Source§fn from(datetime: NaiveDateTime) -> Self
fn from(datetime: NaiveDateTime) -> Self
Source§impl From<SystemTime> for Timestamp
Available on crate feature std only.
impl From<SystemTime> for Timestamp
std only.Source§fn from(system_time: SystemTime) -> Self
fn from(system_time: SystemTime) -> Self
Source§impl FromSql<Datetime, Mysql> for Timestamp
Available on crate feature diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl FromSql<Datetime, Mysql> for Timestamp
diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl FromSql<Timestamp, Mysql> for Timestamp
Available on crate feature diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl FromSql<Timestamp, Mysql> for Timestamp
diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl FromSql<Timestamp, Pg> for Timestamp
Available on crate feature diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl FromSql<Timestamp, Pg> for Timestamp
diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl FromSql<Timestamp, Sqlite> for Timestamp
Available on crate feature diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl FromSql<Timestamp, Sqlite> for Timestamp
diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl FromSql<Timestamptz, Pg> for Timestamp
Available on crate feature diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl FromSql<Timestamptz, Pg> for Timestamp
diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl FromSql<Timestamptz, Sqlite> for Timestamp
Available on crate feature diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl FromSql<Timestamptz, Sqlite> for Timestamp
diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl Message for Timestamp
impl Message for Timestamp
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 Timestamp
impl Name for Timestamp
Source§const PACKAGE: &'static str = PACKAGE_PREFIX
const PACKAGE: &'static str = PACKAGE_PREFIX
., e.g. google.protobuf.Source§const NAME: &'static str = "Timestamp"
const NAME: &'static str = "Timestamp"
Message.
This name is the same as it appears in the source .proto file, e.g. FooBar.Source§fn type_url() -> String
fn type_url() -> String
Message, which by default is the full name with a
leading slash, but may also include a leading domain name, e.g.
type.googleapis.com/google.profile.Person.
This can be used when serializing into the google.protobuf.Any type.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 Ord for Timestamp
impl Ord for Timestamp
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
Source§impl QueryId for Timestamp
impl QueryId for Timestamp
Source§const HAS_STATIC_QUERY_ID: bool = true
const HAS_STATIC_QUERY_ID: bool = true
Self be uniquely identified by its type? Read moreSource§impl ToSql<Datetime, Mysql> for Timestamp
Available on crate feature diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl ToSql<Datetime, Mysql> for Timestamp
diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl ToSql<Timestamp, Mysql> for Timestamp
Available on crate feature diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl ToSql<Timestamp, Mysql> for Timestamp
diesel-mysql and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl ToSql<Timestamp, Pg> for Timestamp
Available on crate feature diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl ToSql<Timestamp, Pg> for Timestamp
diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl ToSql<Timestamp, Sqlite> for Timestamp
Available on crate feature diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl ToSql<Timestamp, Sqlite> for Timestamp
diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl ToSql<Timestamptz, Pg> for Timestamp
Available on crate feature diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl ToSql<Timestamptz, Pg> for Timestamp
diesel-postgres and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl ToSql<Timestamptz, Sqlite> for Timestamp
Available on crate feature diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.
impl ToSql<Timestamptz, Sqlite> for Timestamp
diesel-sqlite and (crate features diesel-postgres or diesel-sqlite or diesel-mysql) only.Source§impl TryFrom<Timestamp> for NaiveDateTime
Available on crate feature chrono only.
impl TryFrom<Timestamp> for NaiveDateTime
chrono only.Source§impl TryFrom<Timestamp> for SystemTime
Available on crate feature std only.
impl TryFrom<Timestamp> for SystemTime
std only.impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, ST, DB> FromSqlRow<ST, DB> for Twhere
T: Queryable<ST, DB>,
ST: SqlTypeOrSelectable,
DB: Backend,
<T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,
impl<T, ST, DB> FromSqlRow<ST, DB> for Twhere
T: Queryable<ST, DB>,
ST: SqlTypeOrSelectable,
DB: Backend,
<T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,
Source§impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
Source§const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more