#[repr(C)]pub struct NSProcessInfo {
pub ptr: Id<Object>,
}
Expand description
A collection of information about the current process.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSProcessInfo
impl NSProcessInfo
Sourcepub fn process_info() -> NSProcessInfo
pub fn process_info() -> NSProcessInfo
Returns the process information agent for the process.
Sourcepub fn arguments(&self) -> NSArray<NSString>
pub fn arguments(&self) -> NSArray<NSString>
Array of strings with the command-line arguments for the process.
Sourcepub fn environment(&self) -> NSDictionary<NSString, NSString>
pub fn environment(&self) -> NSDictionary<NSString, NSString>
The variable names (keys) and their values in the environment from which the process was launched.
Sourcepub fn globally_unique_string(&self) -> NSString
pub fn globally_unique_string(&self) -> NSString
Global unique identifier for the process.
Sourcepub fn mac_catalyst_app(&self) -> bool
pub fn mac_catalyst_app(&self) -> bool
A Boolean value that indicates whether the process originated as an iOS app and runs on macOS.
Sourcepub fn ios_app_on_mac(&self) -> bool
pub fn ios_app_on_mac(&self) -> bool
A Boolean value that indicates whether the process is an iPhone or iPad app running on a Mac.
Sourcepub fn process_identifier(&self) -> Int
pub fn process_identifier(&self) -> Int
The identifier of the process (often called process ID).
Sourcepub fn process_name(&self) -> NSString
pub fn process_name(&self) -> NSString
The name of the process.
Sourcepub fn set_process_name(&mut self, name: NSString)
pub fn set_process_name(&mut self, name: NSString)
Sets the name of the process
§Warning
User defaults and other aspects of the environment might depend on the process name, so be very careful if you change it. Setting the process name in this manner is not thread safe.
Sourcepub fn full_user_name(&self) -> NSString
pub fn full_user_name(&self) -> NSString
Returns the full name of the current user.
Sourcepub fn disable_sudden_termination(&mut self)
pub fn disable_sudden_termination(&mut self)
Disables the application for quickly killing using sudden termination.
Sourcepub fn enable_sudden_termination(&mut self)
pub fn enable_sudden_termination(&mut self)
Enables the application for quick killing using sudden termination.
Sourcepub fn disable_automatic_termination(&mut self, reason: &NSString)
pub fn disable_automatic_termination(&mut self, reason: &NSString)
Disables automatic termination for the application.
Sourcepub fn enable_automatic_termination(&mut self, reason: &NSString)
pub fn enable_automatic_termination(&mut self, reason: &NSString)
Enables automatic termination for the application.
Sourcepub fn automatic_termination_support_enabled(&self) -> bool
pub fn automatic_termination_support_enabled(&self) -> bool
A Boolean value indicating whether the app supports automatic termination.
Sourcepub fn host_name(&self) -> NSString
pub fn host_name(&self) -> NSString
The name of the host computer on which the process is executing.
Sourcepub fn operating_system_version_string(&self) -> NSString
pub fn operating_system_version_string(&self) -> NSString
A string containing the version of the operating system on which the process is executing.
Sourcepub fn operating_system_version(&self) -> NSOperatingSystemVersion
pub fn operating_system_version(&self) -> NSOperatingSystemVersion
The version of the operating system on which the process is executing.
Sourcepub fn is_operating_system_at_least_version(
&self,
version: NSOperatingSystemVersion,
) -> bool
pub fn is_operating_system_at_least_version( &self, version: NSOperatingSystemVersion, ) -> bool
Returns a Boolean value indicating whether the version of the operating system on which the process is executing is the same or later than the given version.
Sourcepub fn operating_system(&self) -> UInt
👎Deprecated: Use operating_system_version
or is_operating_system_at_least_version
instead
pub fn operating_system(&self) -> UInt
operating_system_version
or is_operating_system_at_least_version
insteadReturns a constant to indicate the operating system on which the process is executing.
Sourcepub fn operating_system_name(&self) -> NSString
👎Deprecated: Use operating_system_version
or is_operating_system_at_least_version
instead
pub fn operating_system_name(&self) -> NSString
operating_system_version
or is_operating_system_at_least_version
insteadReturns a string containing the name of the operating system on which the process is executing.
Sourcepub fn processor_count(&self) -> UInt
pub fn processor_count(&self) -> UInt
The number of processing cores available on the computer.
Sourcepub fn active_processor_count(&self) -> UInt
pub fn active_processor_count(&self) -> UInt
The number of active processing cores available on the computer.
Sourcepub fn physical_memory(&self) -> c_ulonglong
pub fn physical_memory(&self) -> c_ulonglong
The amount of physical memory on the computer in bytes.
Sourcepub fn system_uptime(&self) -> NSTimeInterval
pub fn system_uptime(&self) -> NSTimeInterval
The amount of time the system has been awake since the last time it was restarted.
Sourcepub fn begin_activity_with_options_reason(
&self,
options: NSActivityOptions,
reason: &NSString,
) -> id
pub fn begin_activity_with_options_reason( &self, options: NSActivityOptions, reason: &NSString, ) -> id
Begin an activity using the given options and reason.
Sourcepub fn end_activity(&self, activity: id)
pub fn end_activity(&self, activity: id)
Ends the given activity.
Sourcepub fn perform_activity_with_options_reason_using_block<F>(
&self,
activity: id,
reason: &NSString,
block: F,
)
pub fn perform_activity_with_options_reason_using_block<F>( &self, activity: id, reason: &NSString, block: F, )
Synchronously perform an activity defined by a given block using the given options.
Sourcepub fn perform_expiring_activity_with_reason_using_block<F>(
&self,
reason: &NSString,
block: F,
)
pub fn perform_expiring_activity_with_reason_using_block<F>( &self, reason: &NSString, block: F, )
Performs the specified block asynchronously and notifies you if the process is about to be suspended.
Sourcepub fn thermal_state(&self) -> NSProcessInfoThermalState
pub fn thermal_state(&self) -> NSProcessInfoThermalState
The current thermal state of the system.
Sourcepub fn low_power_mode_enabled(&self) -> bool
pub fn low_power_mode_enabled(&self) -> bool
A Boolean value that indicates the current state of Low Power Mode.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Trait Implementations§
Source§impl Clone for NSProcessInfo
impl Clone for NSProcessInfo
Source§impl Debug for NSProcessInfo
impl Debug for NSProcessInfo
Source§impl Deref for NSProcessInfo
impl Deref for NSProcessInfo
Source§impl DerefMut for NSProcessInfo
impl DerefMut for NSProcessInfo
Source§impl Display for NSProcessInfo
impl Display for NSProcessInfo
Source§impl Encode for NSProcessInfo
impl Encode for NSProcessInfo
Source§impl FromId for NSProcessInfo
impl FromId for NSProcessInfo
Source§impl Hash for NSProcessInfo
impl Hash for NSProcessInfo
Source§impl INSProcessInfo for NSProcessInfo
impl INSProcessInfo for NSProcessInfo
Source§fn p_process_info() -> NSProcessInfo
fn p_process_info() -> NSProcessInfo
Source§fn p_arguments(&self) -> NSArray<NSString>
fn p_arguments(&self) -> NSArray<NSString>
Source§fn p_environment(&self) -> NSDictionary<NSString, NSString>
fn p_environment(&self) -> NSDictionary<NSString, NSString>
Source§fn p_globally_unique_string(&self) -> NSString
fn p_globally_unique_string(&self) -> NSString
Source§fn p_mac_catalyst_app(&self) -> bool
fn p_mac_catalyst_app(&self) -> bool
Source§fn p_ios_app_on_mac(&self) -> bool
fn p_ios_app_on_mac(&self) -> bool
Source§fn p_process_identifier(&self) -> Int
fn p_process_identifier(&self) -> Int
Source§fn p_process_name(&self) -> NSString
fn p_process_name(&self) -> NSString
Source§fn p_set_process_name(&mut self, name: NSString)
fn p_set_process_name(&mut self, name: NSString)
Source§fn p_user_name(&self) -> NSString
fn p_user_name(&self) -> NSString
Source§fn p_full_user_name(&self) -> NSString
fn p_full_user_name(&self) -> NSString
Source§fn m_disable_sudden_termination(&mut self)
fn m_disable_sudden_termination(&mut self)
Source§fn m_enable_sudden_termination(&mut self)
fn m_enable_sudden_termination(&mut self)
Source§fn m_disable_automatic_termination(&mut self, reason: &NSString)
fn m_disable_automatic_termination(&mut self, reason: &NSString)
Source§fn m_enable_automatic_termination(&mut self, reason: &NSString)
fn m_enable_automatic_termination(&mut self, reason: &NSString)
Source§fn p_automatic_termination_support_enabled(&self) -> bool
fn p_automatic_termination_support_enabled(&self) -> bool
Source§fn p_host_name(&self) -> NSString
fn p_host_name(&self) -> NSString
Source§fn p_operating_system_version_string(&self) -> NSString
fn p_operating_system_version_string(&self) -> NSString
Source§fn p_operating_system_version(&self) -> NSOperatingSystemVersion
fn p_operating_system_version(&self) -> NSOperatingSystemVersion
Source§fn m_is_operating_system_at_least_version(
&self,
version: NSOperatingSystemVersion,
) -> bool
fn m_is_operating_system_at_least_version( &self, version: NSOperatingSystemVersion, ) -> bool
Source§fn m_operating_system(&self) -> UInt
fn m_operating_system(&self) -> UInt
operating_system_version
or is_operating_system_at_least_version
insteadSource§fn m_operating_system_name(&self) -> NSString
fn m_operating_system_name(&self) -> NSString
operating_system_version
or is_operating_system_at_least_version
instead