#![allow(unused_imports)]
#![allow(deprecated)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(missing_docs)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::type_complexity)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::identity_op)]
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::doc_lazy_continuation)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::invalid_html_tags)]
#[link(name = "OSLog", kind = "framework")]
extern "C" {}
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OSLogEntryStoreCategory(pub NSInteger);
impl OSLogEntryStoreCategory {
#[doc(alias = "OSLogEntryStoreCategoryUndefined")]
pub const Undefined: Self = Self(0);
#[doc(alias = "OSLogEntryStoreCategoryMetadata")]
pub const Metadata: Self = Self(1);
#[doc(alias = "OSLogEntryStoreCategoryShortTerm")]
pub const ShortTerm: Self = Self(2);
#[doc(alias = "OSLogEntryStoreCategoryLongTermAuto")]
pub const LongTermAuto: Self = Self(3);
#[doc(alias = "OSLogEntryStoreCategoryLongTerm1")]
pub const LongTerm1: Self = Self(4);
#[doc(alias = "OSLogEntryStoreCategoryLongTerm3")]
pub const LongTerm3: Self = Self(5);
#[doc(alias = "OSLogEntryStoreCategoryLongTerm7")]
pub const LongTerm7: Self = Self(6);
#[doc(alias = "OSLogEntryStoreCategoryLongTerm14")]
pub const LongTerm14: Self = Self(7);
#[doc(alias = "OSLogEntryStoreCategoryLongTerm30")]
pub const LongTerm30: Self = Self(8);
}
unsafe impl Encode for OSLogEntryStoreCategory {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for OSLogEntryStoreCategory {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogEntry;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogEntry {}
);
impl OSLogEntry {
extern_methods!(
#[unsafe(method(composedMessage))]
#[unsafe(method_family = none)]
pub unsafe fn composedMessage(&self) -> Retained<NSString>;
#[unsafe(method(date))]
#[unsafe(method_family = none)]
pub unsafe fn date(&self) -> Retained<NSDate>;
#[unsafe(method(storeCategory))]
#[unsafe(method_family = none)]
pub unsafe fn storeCategory(&self) -> OSLogEntryStoreCategory;
);
}
impl OSLogEntry {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait OSLogEntryFromProcess {
#[unsafe(method(activityIdentifier))]
#[unsafe(method_family = none)]
unsafe fn activityIdentifier(&self) -> os_activity_id_t;
#[unsafe(method(process))]
#[unsafe(method_family = none)]
unsafe fn process(&self) -> Retained<NSString>;
#[cfg(feature = "libc")]
#[unsafe(method(processIdentifier))]
#[unsafe(method_family = none)]
unsafe fn processIdentifier(&self) -> libc::pid_t;
#[unsafe(method(sender))]
#[unsafe(method_family = none)]
unsafe fn sender(&self) -> Retained<NSString>;
#[unsafe(method(threadIdentifier))]
#[unsafe(method_family = none)]
unsafe fn threadIdentifier(&self) -> u64;
}
);
extern_protocol!(
pub unsafe trait OSLogEntryWithPayload {
#[unsafe(method(category))]
#[unsafe(method_family = none)]
unsafe fn category(&self) -> Retained<NSString>;
#[unsafe(method(components))]
#[unsafe(method_family = none)]
unsafe fn components(&self) -> Retained<NSArray<OSLogMessageComponent>>;
#[unsafe(method(formatString))]
#[unsafe(method_family = none)]
unsafe fn formatString(&self) -> Retained<NSString>;
#[unsafe(method(subsystem))]
#[unsafe(method_family = none)]
unsafe fn subsystem(&self) -> Retained<NSString>;
}
);
impl OSLogEntry {
extern_methods!();
}
extern_conformance!(
unsafe impl NSSecureCoding for OSLogEntry {}
);
extern_class!(
#[unsafe(super(OSLogEntry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogEntryActivity;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogEntryActivity {}
);
extern_conformance!(
unsafe impl OSLogEntryFromProcess for OSLogEntryActivity {}
);
impl OSLogEntryActivity {
extern_methods!(
#[unsafe(method(parentActivityIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn parentActivityIdentifier(&self) -> os_activity_id_t;
);
}
impl OSLogEntryActivity {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(OSLogEntry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogEntryBoundary;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogEntryBoundary {}
);
impl OSLogEntryBoundary {
extern_methods!();
}
impl OSLogEntryBoundary {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OSLogEntryLogLevel(pub NSInteger);
impl OSLogEntryLogLevel {
#[doc(alias = "OSLogEntryLogLevelUndefined")]
pub const Undefined: Self = Self(0);
#[doc(alias = "OSLogEntryLogLevelDebug")]
pub const Debug: Self = Self(1);
#[doc(alias = "OSLogEntryLogLevelInfo")]
pub const Info: Self = Self(2);
#[doc(alias = "OSLogEntryLogLevelNotice")]
pub const Notice: Self = Self(3);
#[doc(alias = "OSLogEntryLogLevelError")]
pub const Error: Self = Self(4);
#[doc(alias = "OSLogEntryLogLevelFault")]
pub const Fault: Self = Self(5);
}
unsafe impl Encode for OSLogEntryLogLevel {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for OSLogEntryLogLevel {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(OSLogEntry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogEntryLog;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogEntryLog {}
);
extern_conformance!(
unsafe impl OSLogEntryFromProcess for OSLogEntryLog {}
);
extern_conformance!(
unsafe impl OSLogEntryWithPayload for OSLogEntryLog {}
);
impl OSLogEntryLog {
extern_methods!(
#[unsafe(method(level))]
#[unsafe(method_family = none)]
pub unsafe fn level(&self) -> OSLogEntryLogLevel;
);
}
impl OSLogEntryLog {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OSLogEntrySignpostType(pub NSInteger);
impl OSLogEntrySignpostType {
#[doc(alias = "OSLogEntrySignpostTypeUndefined")]
pub const Undefined: Self = Self(0);
#[doc(alias = "OSLogEntrySignpostTypeIntervalBegin")]
pub const IntervalBegin: Self = Self(1);
#[doc(alias = "OSLogEntrySignpostTypeIntervalEnd")]
pub const IntervalEnd: Self = Self(2);
#[doc(alias = "OSLogEntrySignpostTypeEvent")]
pub const Event: Self = Self(3);
}
unsafe impl Encode for OSLogEntrySignpostType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for OSLogEntrySignpostType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(OSLogEntry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogEntrySignpost;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogEntrySignpost {}
);
extern_conformance!(
unsafe impl OSLogEntryFromProcess for OSLogEntrySignpost {}
);
extern_conformance!(
unsafe impl OSLogEntryWithPayload for OSLogEntrySignpost {}
);
impl OSLogEntrySignpost {
extern_methods!(
#[unsafe(method(signpostIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn signpostIdentifier(&self) -> os_signpost_id_t;
#[unsafe(method(signpostName))]
#[unsafe(method_family = none)]
pub unsafe fn signpostName(&self) -> Retained<NSString>;
#[unsafe(method(signpostType))]
#[unsafe(method_family = none)]
pub unsafe fn signpostType(&self) -> OSLogEntrySignpostType;
);
}
impl OSLogEntrySignpost {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OSLogEnumeratorOptions(pub NSUInteger);
bitflags::bitflags! {
impl OSLogEnumeratorOptions: NSUInteger {
#[doc(alias = "OSLogEnumeratorReverse")]
const Reverse = 0x01;
}
}
unsafe impl Encode for OSLogEnumeratorOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for OSLogEnumeratorOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSEnumerator, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogEnumerator;
);
extern_conformance!(
unsafe impl NSFastEnumeration for OSLogEnumerator {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogEnumerator {}
);
impl OSLogEnumerator {
extern_methods!();
}
impl OSLogEnumerator {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OSLogMessageComponentArgumentCategory(pub NSInteger);
impl OSLogMessageComponentArgumentCategory {
#[doc(alias = "OSLogMessageComponentArgumentCategoryUndefined")]
pub const Undefined: Self = Self(0);
#[doc(alias = "OSLogMessageComponentArgumentCategoryData")]
pub const Data: Self = Self(1);
#[doc(alias = "OSLogMessageComponentArgumentCategoryDouble")]
pub const Double: Self = Self(2);
#[doc(alias = "OSLogMessageComponentArgumentCategoryInt64")]
pub const Int64: Self = Self(3);
#[doc(alias = "OSLogMessageComponentArgumentCategoryString")]
pub const String: Self = Self(4);
#[doc(alias = "OSLogMessageComponentArgumentCategoryUInt64")]
pub const UInt64: Self = Self(5);
}
unsafe impl Encode for OSLogMessageComponentArgumentCategory {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for OSLogMessageComponentArgumentCategory {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogMessageComponent;
);
extern_conformance!(
unsafe impl NSCoding for OSLogMessageComponent {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogMessageComponent {}
);
extern_conformance!(
unsafe impl NSSecureCoding for OSLogMessageComponent {}
);
impl OSLogMessageComponent {
extern_methods!(
#[unsafe(method(formatSubstring))]
#[unsafe(method_family = none)]
pub unsafe fn formatSubstring(&self) -> Retained<NSString>;
#[unsafe(method(placeholder))]
#[unsafe(method_family = none)]
pub unsafe fn placeholder(&self) -> Retained<NSString>;
#[unsafe(method(argumentCategory))]
#[unsafe(method_family = none)]
pub unsafe fn argumentCategory(&self) -> OSLogMessageComponentArgumentCategory;
#[unsafe(method(argumentDataValue))]
#[unsafe(method_family = none)]
pub unsafe fn argumentDataValue(&self) -> Option<Retained<NSData>>;
#[unsafe(method(argumentDoubleValue))]
#[unsafe(method_family = none)]
pub unsafe fn argumentDoubleValue(&self) -> c_double;
#[unsafe(method(argumentInt64Value))]
#[unsafe(method_family = none)]
pub unsafe fn argumentInt64Value(&self) -> i64;
#[unsafe(method(argumentNumberValue))]
#[unsafe(method_family = none)]
pub unsafe fn argumentNumberValue(&self) -> Option<Retained<NSNumber>>;
#[unsafe(method(argumentStringValue))]
#[unsafe(method_family = none)]
pub unsafe fn argumentStringValue(&self) -> Option<Retained<NSString>>;
#[unsafe(method(argumentUInt64Value))]
#[unsafe(method_family = none)]
pub unsafe fn argumentUInt64Value(&self) -> u64;
);
}
impl OSLogMessageComponent {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogPosition;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogPosition {}
);
impl OSLogPosition {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl OSLogPosition {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OSLogStoreScope(pub NSInteger);
impl OSLogStoreScope {
#[doc(alias = "OSLogStoreSystem")]
pub const System: Self = Self(0);
#[doc(alias = "OSLogStoreCurrentProcessIdentifier")]
pub const CurrentProcessIdentifier: Self = Self(1);
}
unsafe impl Encode for OSLogStoreScope {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for OSLogStoreScope {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct OSLogStore;
);
extern_conformance!(
unsafe impl NSObjectProtocol for OSLogStore {}
);
impl OSLogStore {
extern_methods!(
#[unsafe(method(localStoreAndReturnError:_))]
#[unsafe(method_family = none)]
pub unsafe fn localStoreAndReturnError() -> Result<Retained<Self>, Retained<NSError>>;
#[unsafe(method(storeWithScope:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn storeWithScope_error(
scope: OSLogStoreScope,
) -> Result<Retained<Self>, Retained<NSError>>;
#[unsafe(method(storeWithURL:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn storeWithURL_error(url: &NSURL) -> Result<Retained<Self>, Retained<NSError>>;
#[deprecated = "Use one of the factory methods"]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(entriesEnumeratorWithOptions:position:predicate:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn entriesEnumeratorWithOptions_position_predicate_error(
&self,
options: OSLogEnumeratorOptions,
position: Option<&OSLogPosition>,
predicate: Option<&NSPredicate>,
) -> Result<Retained<OSLogEnumerator>, Retained<NSError>>;
#[unsafe(method(entriesEnumeratorAndReturnError:_))]
#[unsafe(method_family = none)]
pub unsafe fn entriesEnumeratorAndReturnError(
&self,
) -> Result<Retained<OSLogEnumerator>, Retained<NSError>>;
#[unsafe(method(positionWithDate:))]
#[unsafe(method_family = none)]
pub unsafe fn positionWithDate(&self, date: &NSDate) -> Retained<OSLogPosition>;
#[unsafe(method(positionWithTimeIntervalSinceEnd:))]
#[unsafe(method_family = none)]
pub unsafe fn positionWithTimeIntervalSinceEnd(
&self,
seconds: NSTimeInterval,
) -> Retained<OSLogPosition>;
#[unsafe(method(positionWithTimeIntervalSinceLatestBoot:))]
#[unsafe(method_family = none)]
pub unsafe fn positionWithTimeIntervalSinceLatestBoot(
&self,
seconds: NSTimeInterval,
) -> Retained<OSLogPosition>;
);
}
impl OSLogStore {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}