Skip to main content

ProcessInfo

Struct ProcessInfo 

Source
pub struct ProcessInfo(/* private fields */);
Expand description

An Objective-C process info object.

C++ equivalent: NS::ProcessInfo

Implementations§

Source§

impl ProcessInfo

Source

pub fn process_info() -> Option<Self>

Get the process info singleton.

C++ equivalent: static ProcessInfo* processInfo()

Source

pub fn arguments(&self) -> *mut Array<String>

Get the command-line arguments.

C++ equivalent: class Array* arguments() const

Source

pub fn environment(&self) -> *mut Dictionary

Get the environment dictionary.

C++ equivalent: class Dictionary* environment() const

Source

pub fn host_name(&self) -> *mut String

Get the host name.

C++ equivalent: class String* hostName() const

Source

pub fn process_name(&self) -> *mut String

Get the process name.

C++ equivalent: class String* processName() const

Source

pub fn set_process_name(&self, name: &String)

Set the process name.

C++ equivalent: void setProcessName(const String* pString)

Source

pub fn process_identifier(&self) -> i32

Get the process identifier.

C++ equivalent: int processIdentifier() const

Source

pub fn globally_unique_string(&self) -> *mut String

Get a globally unique string.

C++ equivalent: class String* globallyUniqueString() const

Source

pub fn user_name(&self) -> *mut String

Get the user name.

Source

pub fn full_user_name(&self) -> *mut String

Get the full user name.

Source

pub fn operating_system(&self) -> UInteger

Get the operating system identifier.

C++ equivalent: UInteger operatingSystem() const

Source

pub fn operating_system_version(&self) -> OperatingSystemVersion

Get the operating system version.

C++ equivalent: OperatingSystemVersion operatingSystemVersion() const

Source

pub fn operating_system_version_string(&self) -> *mut String

Get the operating system version string.

C++ equivalent: class String* operatingSystemVersionString() const

Source

pub fn is_operating_system_at_least_version( &self, version: OperatingSystemVersion, ) -> bool

Check if the operating system is at least a given version.

C++ equivalent: bool isOperatingSystemAtLeastVersion(OperatingSystemVersion version) const

Source

pub fn processor_count(&self) -> UInteger

Get the processor count.

C++ equivalent: UInteger processorCount() const

Source

pub fn active_processor_count(&self) -> UInteger

Get the active processor count.

C++ equivalent: UInteger activeProcessorCount() const

Source

pub fn physical_memory(&self) -> u64

Get the physical memory size.

C++ equivalent: unsigned long long physicalMemory() const

Source

pub fn system_uptime(&self) -> TimeInterval

Get the system uptime.

C++ equivalent: TimeInterval systemUptime() const

Source

pub fn disable_sudden_termination(&self)

Disable sudden termination.

C++ equivalent: void disableSuddenTermination()

Source

pub fn enable_sudden_termination(&self)

Enable sudden termination.

C++ equivalent: void enableSuddenTermination()

Source

pub fn disable_automatic_termination(&self, reason: &String)

Disable automatic termination.

C++ equivalent: void disableAutomaticTermination(const class String* pReason)

Source

pub fn enable_automatic_termination(&self, reason: &String)

Enable automatic termination.

C++ equivalent: void enableAutomaticTermination(const class String* pReason)

Source

pub fn automatic_termination_support_enabled(&self) -> bool

Check if automatic termination support is enabled.

C++ equivalent: bool automaticTerminationSupportEnabled() const

Source

pub fn set_automatic_termination_support_enabled(&self, enabled: bool)

Set automatic termination support enabled.

C++ equivalent: void setAutomaticTerminationSupportEnabled(bool enabled)

Source

pub fn begin_activity( &self, options: ActivityOptions, reason: &String, ) -> *mut Object

Begin an activity.

C++ equivalent: class Object* beginActivity(ActivityOptions options, const class String* pReason)

Source

pub fn end_activity(&self, activity: &Object)

End an activity.

C++ equivalent: void endActivity(class Object* pActivity)

Source

pub fn thermal_state(&self) -> ProcessInfoThermalState

Get the thermal state.

C++ equivalent: ProcessInfoThermalState thermalState() const

Source

pub fn is_low_power_mode_enabled(&self) -> bool

Check if low power mode is enabled.

C++ equivalent: bool isLowPowerModeEnabled() const

Source

pub fn is_ios_app_on_mac(&self) -> bool

Check if this is an iOS app running on Mac.

C++ equivalent: bool isiOSAppOnMac() const

Source

pub fn is_mac_catalyst_app(&self) -> bool

Check if this is a Mac Catalyst app.

C++ equivalent: bool isMacCatalystApp() const

Source

pub fn is_device_certified(&self, performance_tier: DeviceCertification) -> bool

Check if the device is certified.

C++ equivalent: bool isDeviceCertified(DeviceCertification performanceTier) const

Source

pub fn has_performance_profile( &self, performance_profile: ProcessPerformanceProfile, ) -> bool

Check if the process has a performance profile.

C++ equivalent: bool hasPerformanceProfile(ProcessPerformanceProfile performanceProfile) const

Source

pub unsafe fn from_ptr(ptr: *mut c_void) -> Option<Self>

Create a ProcessInfo from a raw pointer.

§Safety

The pointer must be a valid Objective-C NSProcessInfo object.

Trait Implementations§

Source§

impl Clone for ProcessInfo

Source§

fn clone(&self) -> ProcessInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProcessInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Referencing for ProcessInfo

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> UInteger

Get the retain count of the object. Read more
Source§

impl Send for ProcessInfo

Source§

impl Sync for ProcessInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.