pub struct TestTimeZone { /* private fields */ }Expand description
A local time zone for a test: UTC, a fixed offset and name, or any rule of the instant, such as a zone with summer time.
Implementations§
Source§impl TestTimeZone
impl TestTimeZone
Sourcepub fn utc() -> TestTimeZone
pub fn utc() -> TestTimeZone
UTC, the zone a TestPlatform starts in.
Sourcepub fn fixed(offset: SignedDuration, name: &str) -> TestTimeZone
pub fn fixed(offset: SignedDuration, name: &str) -> TestTimeZone
A zone that is offset from UTC all year, named name.
Sourcepub fn new(
rule: impl Fn(i64) -> (SignedDuration, String) + 'static,
) -> TestTimeZone
pub fn new( rule: impl Fn(i64) -> (SignedDuration, String) + 'static, ) -> TestTimeZone
A zone whose offset and name at an instant in seconds since the epoch rule answers.
Sourcepub fn offset(&self, seconds_since_epoch: i64) -> SignedDuration
pub fn offset(&self, seconds_since_epoch: i64) -> SignedDuration
The offset from UTC at seconds_since_epoch.
Trait Implementations§
Source§impl Clone for TestTimeZone
impl Clone for TestTimeZone
Source§impl Debug for TestTimeZone
impl Debug for TestTimeZone
Source§impl Default for TestTimeZone
impl Default for TestTimeZone
Source§fn default() -> TestTimeZone
fn default() -> TestTimeZone
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TestTimeZone
impl !Send for TestTimeZone
impl !Sync for TestTimeZone
impl !UnwindSafe for TestTimeZone
impl Forget for TestTimeZone
impl Freeze for TestTimeZonewhere
*const RcInner<dyn Fn(i64) -> (SignedDuration, String)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(i64) -> (SignedDuration, String)>>: Freeze,
impl Move for TestTimeZone
impl Unpin for TestTimeZone
impl UnsafeUnpin for TestTimeZonewhere
*const RcInner<dyn Fn(i64) -> (SignedDuration, String)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(i64) -> (SignedDuration, String)>>: UnsafeUnpin,
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