summaryrefslogtreecommitdiff
path: root/vendor/time/src/macros.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-15 16:37:08 -0600
committermo khan <mo@mokhan.ca>2025-07-17 16:30:22 -0600
commit45df4d0d9b577fecee798d672695fe24ff57fb1b (patch)
tree1b99bf645035b58e0d6db08c7a83521f41f7a75b /vendor/time/src/macros.rs
parentf94f79608393d4ab127db63cc41668445ef6b243 (diff)
feat: migrate from Cedar to SpiceDB authorization system
This is a major architectural change that replaces the Cedar policy-based authorization system with SpiceDB's relation-based authorization. Key changes: - Migrate from Rust to Go implementation - Replace Cedar policies with SpiceDB schema and relationships - Switch from envoy `ext_authz` with Cedar to SpiceDB permission checks - Update build system and dependencies for Go ecosystem - Maintain Envoy integration for external authorization This change enables more flexible permission modeling through SpiceDB's Google Zanzibar inspired relation-based system, supporting complex hierarchical permissions that were difficult to express in Cedar. Breaking change: Existing Cedar policies and Rust-based configuration will no longer work and need to be migrated to SpiceDB schema.
Diffstat (limited to 'vendor/time/src/macros.rs')
-rw-r--r--vendor/time/src/macros.rs149
1 files changed, 0 insertions, 149 deletions
diff --git a/vendor/time/src/macros.rs b/vendor/time/src/macros.rs
deleted file mode 100644
index e9ca572e..00000000
--- a/vendor/time/src/macros.rs
+++ /dev/null
@@ -1,149 +0,0 @@
-//! Macros to construct statically known values.
-
-/// Construct a [`Date`](crate::Date) with a statically known value.
-///
-/// The resulting expression can be used in `const` or `static` declarations.
-///
-/// Three formats are supported: year-week-weekday, year-ordinal, and year-month-day.
-///
-/// ```rust
-/// # use time::{Date, Weekday::*, Month, macros::date};
-/// assert_eq!(
-/// date!(2020 - W 01 - 3),
-/// Date::from_iso_week_date(2020, 1, Wednesday)?
-/// );
-/// assert_eq!(date!(2020-001), Date::from_ordinal_date(2020, 1)?);
-/// assert_eq!(
-/// date!(2020-01-01),
-/// Date::from_calendar_date(2020, Month::January, 1)?
-/// );
-/// # Ok::<_, time::Error>(())
-/// ```
-pub use time_macros::date;
-/// Construct a [`PrimitiveDateTime`] or [`OffsetDateTime`] with a statically known value.
-///
-/// The resulting expression can be used in `const` or `static` declarations.
-///
-/// The syntax accepted by this macro is the same as [`date!`] and [`time!`], with an optional
-/// [`offset!`], all space-separated. If an [`offset!`] is provided, the resulting value will
-/// be an [`OffsetDateTime`]; otherwise it will be a [`PrimitiveDateTime`].
-///
-/// [`OffsetDateTime`]: crate::OffsetDateTime
-/// [`PrimitiveDateTime`]: crate::PrimitiveDateTime
-///
-/// ```rust
-/// # use time::{Date, Month, macros::datetime, UtcOffset};
-/// assert_eq!(
-/// datetime!(2020-01-01 0:00),
-/// Date::from_calendar_date(2020, Month::January, 1)?.midnight()
-/// );
-/// assert_eq!(
-/// datetime!(2020-01-01 0:00 UTC),
-/// Date::from_calendar_date(2020, Month::January, 1)?.midnight().assume_utc()
-/// );
-/// assert_eq!(
-/// datetime!(2020-01-01 0:00 -1),
-/// Date::from_calendar_date(2020, Month::January, 1)?.midnight()
-/// .assume_offset(UtcOffset::from_hms(-1, 0, 0)?)
-/// );
-/// # Ok::<_, time::Error>(())
-/// ```
-pub use time_macros::datetime;
-/// Equivalent of performing [`format_description::parse()`] at compile time.
-///
-/// Using the macro instead of the function results in a static slice rather than a
-/// [`Vec`](alloc::vec::Vec), such that it can be used in `#![no_alloc]` situations.
-///
-/// The resulting expression can be used in `const` or `static` declarations, and implements
-/// the sealed traits required for both formatting and parsing.
-#[cfg_attr(feature = "alloc", doc = "```rust")]
-#[cfg_attr(not(feature = "alloc"), doc = "```rust,ignore")]
-/// # use time::{format_description, macros::format_description};
-/// assert_eq!(
-/// format_description!("[hour]:[minute]:[second]"),
-/// format_description::parse("[hour]:[minute]:[second]")?
-/// );
-/// # Ok::<_, time::Error>(())
-/// ```
-///
-/// The syntax accepted by this macro is the same as [`format_description::parse()`], which can
-/// be found in [the book](https://time-rs.github.io/book/api/format-description.html).
-///
-/// [`format_description::parse()`]: crate::format_description::parse()
-#[cfg(any(feature = "formatting", feature = "parsing"))]
-pub use time_macros::format_description;
-/// Construct a [`UtcOffset`](crate::UtcOffset) with a statically known value.
-///
-/// The resulting expression can be used in `const` or `static` declarations.
-///
-/// A sign and the hour must be provided; minutes and seconds default to zero. `UTC` (both
-/// uppercase and lowercase) is also allowed.
-///
-/// ```rust
-/// # use time::{UtcOffset, macros::offset};
-/// assert_eq!(offset!(UTC), UtcOffset::from_hms(0, 0, 0)?);
-/// assert_eq!(offset!(utc), UtcOffset::from_hms(0, 0, 0)?);
-/// assert_eq!(offset!(+0), UtcOffset::from_hms(0, 0, 0)?);
-/// assert_eq!(offset!(+1), UtcOffset::from_hms(1, 0, 0)?);
-/// assert_eq!(offset!(-1), UtcOffset::from_hms(-1, 0, 0)?);
-/// assert_eq!(offset!(+1:30), UtcOffset::from_hms(1, 30, 0)?);
-/// assert_eq!(offset!(-1:30), UtcOffset::from_hms(-1, -30, 0)?);
-/// assert_eq!(offset!(+1:30:59), UtcOffset::from_hms(1, 30, 59)?);
-/// assert_eq!(offset!(-1:30:59), UtcOffset::from_hms(-1, -30, -59)?);
-/// assert_eq!(offset!(+23:59:59), UtcOffset::from_hms(23, 59, 59)?);
-/// assert_eq!(offset!(-23:59:59), UtcOffset::from_hms(-23, -59, -59)?);
-/// # Ok::<_, time::Error>(())
-/// ```
-pub use time_macros::offset;
-/// Construct a [`Time`](crate::Time) with a statically known value.
-///
-/// The resulting expression can be used in `const` or `static` declarations.
-///
-/// Hours and minutes must be provided, while seconds defaults to zero. AM/PM is allowed
-/// (either uppercase or lowercase). Any number of subsecond digits may be provided (though any
-/// past nine will be discarded).
-///
-/// All components are validated at compile-time. An error will be raised if any value is
-/// invalid.
-///
-/// ```rust
-/// # use time::{Time, macros::time};
-/// assert_eq!(time!(0:00), Time::from_hms(0, 0, 0)?);
-/// assert_eq!(time!(1:02:03), Time::from_hms(1, 2, 3)?);
-/// assert_eq!(
-/// time!(1:02:03.004_005_006),
-/// Time::from_hms_nano(1, 2, 3, 4_005_006)?
-/// );
-/// assert_eq!(time!(12:00 am), Time::from_hms(0, 0, 0)?);
-/// assert_eq!(time!(1:02:03 am), Time::from_hms(1, 2, 3)?);
-/// assert_eq!(
-/// time!(1:02:03.004_005_006 am),
-/// Time::from_hms_nano(1, 2, 3, 4_005_006)?
-/// );
-/// assert_eq!(time!(12 pm), Time::from_hms(12, 0, 0)?);
-/// assert_eq!(time!(12:00 pm), Time::from_hms(12, 0, 0)?);
-/// assert_eq!(time!(1:02:03 pm), Time::from_hms(13, 2, 3)?);
-/// assert_eq!(
-/// time!(1:02:03.004_005_006 pm),
-/// Time::from_hms_nano(13, 2, 3, 4_005_006)?
-/// );
-/// # Ok::<_, time::Error>(())
-/// ```
-pub use time_macros::time;
-/// Construct a [`UtcDateTime`] with a statically known value.
-///
-/// The resulting expression can be used in `const` or `static` declarations.
-///
-/// The syntax accepted by this macro is the same as a space-separated [`date!`] and [`time!`].
-///
-/// [`UtcDateTime`]: crate::UtcDateTime
-///
-/// ```rust
-/// # use time::{Date, Month, macros::utc_datetime};
-/// assert_eq!(
-/// utc_datetime!(2020-01-01 0:00),
-/// Date::from_calendar_date(2020, Month::January, 1)?.midnight().as_utc()
-/// );
-/// # Ok::<_, time::Error>(())
-/// ```
-pub use time_macros::utc_datetime;