Struct objc2_foundation::NSCalendar
source · #[repr(C)]pub struct NSCalendar { /* private fields */ }
Available on crate feature
NSCalendar
only.Implementations§
source§impl NSCalendar
impl NSCalendar
pub unsafe fn currentCalendar() -> Retained<NSCalendar>
pub unsafe fn autoupdatingCurrentCalendar() -> Retained<NSCalendar>
pub unsafe fn calendarWithIdentifier( calendar_identifier_constant: &NSCalendarIdentifier ) -> Option<Retained<NSCalendar>>
Available on crate feature
NSString
only.pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>
pub unsafe fn initWithCalendarIdentifier( this: Allocated<Self>, ident: &NSCalendarIdentifier ) -> Option<Retained<Self>>
Available on crate feature
NSString
only.pub unsafe fn calendarIdentifier(&self) -> Retained<NSCalendarIdentifier>
Available on crate feature
NSString
only.pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>
Available on crate feature
NSLocale
only.pub unsafe fn setLocale(&self, locale: Option<&NSLocale>)
Available on crate feature
NSLocale
only.pub unsafe fn timeZone(&self) -> Retained<NSTimeZone>
Available on crate feature
NSTimeZone
only.pub unsafe fn setTimeZone(&self, time_zone: &NSTimeZone)
Available on crate feature
NSTimeZone
only.pub unsafe fn firstWeekday(&self) -> NSUInteger
pub unsafe fn setFirstWeekday(&self, first_weekday: NSUInteger)
pub unsafe fn minimumDaysInFirstWeek(&self) -> NSUInteger
pub unsafe fn setMinimumDaysInFirstWeek( &self, minimum_days_in_first_week: NSUInteger )
pub unsafe fn eraSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn longEraSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn monthSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn shortMonthSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn veryShortMonthSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn standaloneMonthSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn shortStandaloneMonthSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn veryShortStandaloneMonthSymbols( &self ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn weekdaySymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn shortWeekdaySymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn veryShortWeekdaySymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn standaloneWeekdaySymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn shortStandaloneWeekdaySymbols( &self ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn veryShortStandaloneWeekdaySymbols( &self ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn quarterSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn shortQuarterSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn standaloneQuarterSymbols(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn shortStandaloneQuarterSymbols( &self ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn AMSymbol(&self) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn PMSymbol(&self) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn minimumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange
Available on crate feature
NSRange
only.pub unsafe fn maximumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange
Available on crate feature
NSRange
only.pub unsafe fn rangeOfUnit_inUnit_forDate( &self, smaller: NSCalendarUnit, larger: NSCalendarUnit, date: &NSDate ) -> NSRange
Available on crate features
NSDate
and NSRange
only.pub unsafe fn ordinalityOfUnit_inUnit_forDate( &self, smaller: NSCalendarUnit, larger: NSCalendarUnit, date: &NSDate ) -> NSUInteger
Available on crate feature
NSDate
only.pub unsafe fn rangeOfUnit_startDate_interval_forDate( &self, unit: NSCalendarUnit, datep: Option<&mut Option<Retained<NSDate>>>, tip: *mut NSTimeInterval, date: &NSDate ) -> bool
Available on crate feature
NSDate
only.pub unsafe fn dateFromComponents( &self, comps: &NSDateComponents ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn components_fromDate( &self, unit_flags: NSCalendarUnit, date: &NSDate ) -> Retained<NSDateComponents>
Available on crate feature
NSDate
only.pub unsafe fn dateByAddingComponents_toDate_options( &self, comps: &NSDateComponents, date: &NSDate, opts: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn components_fromDate_toDate_options( &self, unit_flags: NSCalendarUnit, starting_date: &NSDate, result_date: &NSDate, opts: NSCalendarOptions ) -> Retained<NSDateComponents>
Available on crate feature
NSDate
only.pub unsafe fn getEra_year_month_day_fromDate( &self, era_value_pointer: *mut NSInteger, year_value_pointer: *mut NSInteger, month_value_pointer: *mut NSInteger, day_value_pointer: *mut NSInteger, date: &NSDate )
Available on crate feature
NSDate
only.pub unsafe fn getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate( &self, era_value_pointer: *mut NSInteger, year_value_pointer: *mut NSInteger, week_value_pointer: *mut NSInteger, weekday_value_pointer: *mut NSInteger, date: &NSDate )
Available on crate feature
NSDate
only.pub unsafe fn getHour_minute_second_nanosecond_fromDate( &self, hour_value_pointer: *mut NSInteger, minute_value_pointer: *mut NSInteger, second_value_pointer: *mut NSInteger, nanosecond_value_pointer: *mut NSInteger, date: &NSDate )
Available on crate feature
NSDate
only.pub unsafe fn component_fromDate( &self, unit: NSCalendarUnit, date: &NSDate ) -> NSInteger
Available on crate feature
NSDate
only.pub unsafe fn dateWithEra_year_month_day_hour_minute_second_nanosecond( &self, era_value: NSInteger, year_value: NSInteger, month_value: NSInteger, day_value: NSInteger, hour_value: NSInteger, minute_value: NSInteger, second_value: NSInteger, nanosecond_value: NSInteger ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond( &self, era_value: NSInteger, year_value: NSInteger, week_value: NSInteger, weekday_value: NSInteger, hour_value: NSInteger, minute_value: NSInteger, second_value: NSInteger, nanosecond_value: NSInteger ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn startOfDayForDate(&self, date: &NSDate) -> Retained<NSDate>
Available on crate feature
NSDate
only.pub unsafe fn componentsInTimeZone_fromDate( &self, timezone: &NSTimeZone, date: &NSDate ) -> Retained<NSDateComponents>
Available on crate features
NSDate
and NSTimeZone
only.pub unsafe fn compareDate_toDate_toUnitGranularity( &self, date1: &NSDate, date2: &NSDate, unit: NSCalendarUnit ) -> NSComparisonResult
Available on crate features
NSDate
and NSObjCRuntime
only.pub unsafe fn isDate_equalToDate_toUnitGranularity( &self, date1: &NSDate, date2: &NSDate, unit: NSCalendarUnit ) -> bool
Available on crate feature
NSDate
only.pub unsafe fn isDate_inSameDayAsDate( &self, date1: &NSDate, date2: &NSDate ) -> bool
Available on crate feature
NSDate
only.pub unsafe fn isDateInToday(&self, date: &NSDate) -> bool
Available on crate feature
NSDate
only.pub unsafe fn isDateInYesterday(&self, date: &NSDate) -> bool
Available on crate feature
NSDate
only.pub unsafe fn isDateInTomorrow(&self, date: &NSDate) -> bool
Available on crate feature
NSDate
only.pub unsafe fn isDateInWeekend(&self, date: &NSDate) -> bool
Available on crate feature
NSDate
only.pub unsafe fn rangeOfWeekendStartDate_interval_containingDate( &self, datep: Option<&mut Option<Retained<NSDate>>>, tip: *mut NSTimeInterval, date: &NSDate ) -> bool
Available on crate feature
NSDate
only.pub unsafe fn nextWeekendStartDate_interval_options_afterDate( &self, datep: Option<&mut Option<Retained<NSDate>>>, tip: *mut NSTimeInterval, options: NSCalendarOptions, date: &NSDate ) -> bool
Available on crate feature
NSDate
only.pub unsafe fn components_fromDateComponents_toDateComponents_options( &self, unit_flags: NSCalendarUnit, starting_date_comp: &NSDateComponents, result_date_comp: &NSDateComponents, options: NSCalendarOptions ) -> Retained<NSDateComponents>
pub unsafe fn dateByAddingUnit_value_toDate_options( &self, unit: NSCalendarUnit, value: NSInteger, date: &NSDate, options: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock( &self, start: &NSDate, comps: &NSDateComponents, opts: NSCalendarOptions, block: &Block<dyn Fn(*mut NSDate, Bool, NonNull<Bool>) + '_> )
Available on crate features
NSDate
and block2
only.pub unsafe fn nextDateAfterDate_matchingComponents_options( &self, date: &NSDate, comps: &NSDateComponents, options: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn nextDateAfterDate_matchingUnit_value_options( &self, date: &NSDate, unit: NSCalendarUnit, value: NSInteger, options: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn nextDateAfterDate_matchingHour_minute_second_options( &self, date: &NSDate, hour_value: NSInteger, minute_value: NSInteger, second_value: NSInteger, options: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn dateBySettingUnit_value_ofDate_options( &self, unit: NSCalendarUnit, v: NSInteger, date: &NSDate, opts: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn dateBySettingHour_minute_second_ofDate_options( &self, h: NSInteger, m: NSInteger, s: NSInteger, date: &NSDate, opts: NSCalendarOptions ) -> Option<Retained<NSDate>>
Available on crate feature
NSDate
only.pub unsafe fn date_matchesComponents( &self, date: &NSDate, components: &NSDateComponents ) -> bool
Available on crate feature
NSDate
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl AsMut<AnyObject> for NSCalendar
impl AsMut<AnyObject> for NSCalendar
source§impl AsMut<NSCalendar> for NSCalendar
impl AsMut<NSCalendar> for NSCalendar
source§impl AsMut<NSObject> for NSCalendar
impl AsMut<NSObject> for NSCalendar
source§impl AsRef<AnyObject> for NSCalendar
impl AsRef<AnyObject> for NSCalendar
source§impl AsRef<NSCalendar> for NSCalendar
impl AsRef<NSCalendar> for NSCalendar
source§impl AsRef<NSObject> for NSCalendar
impl AsRef<NSObject> for NSCalendar
source§impl Borrow<AnyObject> for NSCalendar
impl Borrow<AnyObject> for NSCalendar
source§impl Borrow<NSObject> for NSCalendar
impl Borrow<NSObject> for NSCalendar
source§impl BorrowMut<AnyObject> for NSCalendar
impl BorrowMut<AnyObject> for NSCalendar
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSCalendar
impl BorrowMut<NSObject> for NSCalendar
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for NSCalendar
impl ClassType for NSCalendar
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSCalendar"
const NAME: &'static str = "NSCalendar"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl Debug for NSCalendar
impl Debug for NSCalendar
source§impl Deref for NSCalendar
impl Deref for NSCalendar
source§impl DerefMut for NSCalendar
impl DerefMut for NSCalendar
source§impl Hash for NSCalendar
impl Hash for NSCalendar
source§impl NSCoding for NSCalendar
Available on crate feature NSObject
only.
impl NSCoding for NSCalendar
Available on crate feature
NSObject
only.source§impl NSCopying for NSCalendar
Available on crate feature NSObject
only.
impl NSCopying for NSCalendar
Available on crate feature
NSObject
only.source§impl NSObjectProtocol for NSCalendar
impl NSObjectProtocol for NSCalendar
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl NSSecureCoding for NSCalendar
Available on crate feature NSObject
only.
impl NSSecureCoding for NSCalendar
Available on crate feature
NSObject
only.source§impl PartialEq for NSCalendar
impl PartialEq for NSCalendar
source§fn eq(&self, other: &NSCalendar) -> bool
fn eq(&self, other: &NSCalendar) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSCalendar
impl RefEncode for NSCalendar
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSCalendar
impl Message for NSCalendar
impl StructuralPartialEq for NSCalendar
Auto Trait Implementations§
impl !Freeze for NSCalendar
impl !RefUnwindSafe for NSCalendar
impl !Send for NSCalendar
impl !Sync for NSCalendar
impl !Unpin for NSCalendar
impl !UnwindSafe for NSCalendar
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> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more