Struct droid_wrap::android::content::Context

source ·
pub struct Context { /* private fields */ }
Expand description
  • 与应用程序环境相关的全局信息的接口。这是一个抽象类,其实现由 Android 系统提供。它允许访问特定于应用程序的资源和类,以及对应用程序级操作(如启动活动、广播和接收意图等)的向上调用。

Implementations§

source§

impl Context

source

pub const POWER_SERVICE: &'static str = "power"

与 getSystemService(String) 一起使用来查询 android.os.PowerManager 来控制电源管理,包括“唤醒锁”,它可让您在运行长时间任务时保持设备开启。

source

pub const POWER_STATS_SERVICE: &'static str = "powerstats"

与 getSystemService(String) 一起使用来查询 android.os.PowerStatsService 以访问电力统计服务。

source

pub const RECOVERY_SERVICE: &'static str = "recovery"

与 getSystemService(String) 一起使用来查询 android.os.RecoverySystem 以访问恢复系统服务。

source

pub const SYSTEM_UPDATE_SERVICE: &'static str = "system_update"

与 getSystemService(String) 一起使用来查询 android.os.SystemUpdateManager 以访问系统更新管理器服务。

source

pub const WINDOW_SERVICE: &'static str = "window"

与GetSystemService(String)一起查询android.view.WindowManager访问系统的窗口管理器。

source

pub const LAYOUT_INFLATER_SERVICE: &'static str = "layout_inflater"

与 getSystemService(String) 一起使用来查询 android.view.LayoutInflater 以在此上下文中扩充布局资源。

source

pub const ACCOUNT_SERVICE: &'static str = "account"

与 getSystemService(String) 一起使用来查询 android.accounts.AccountManager,以便在您选择的时间接收意图。

source

pub const ACTIVITY_SERVICE: &'static str = "activity"

与 getSystemService(String) 一起使用来查询 android.app.ActivityManager 以便与全局系统状态进行交互。

source

pub const ACTIVITY_TASK_SERVICE: &'static str = "activity_task"

与 getSystemService(String) 一起使用来查询 android.app.ActivityTaskManager 以便与全局系统状态进行交互。

source

pub const URI_GRANTS_SERVICE: &'static str = "uri_grants"

与 getSystemService(String) 一起使用来查询 android.app.UriGrantsManager 以便与全局系统状态进行交互。

source

pub const ALARM_SERVICE: &'static str = "alarm"

与GetSystemService(String)一起查询android.app.AlarmManager在您选择时接收意图。

source

pub const NOTIFICATION_SERVICE: &'static str = "notification"

与GetSystemService(String)一起查询android.app.NotificationManager,以告知用户背景事件。

source

pub const ACCESSIBILITY_SERVICE: &'static str = "accessibility"

与 getSystemService(String) 一起使用来查询 android.view.accessibility.AccessibilityManager,以便通过注册的事件监听器向用户提供 UI 事件的反馈。

source

pub const CAPTIONING_SERVICE: &'static str = "captioning"

与 getSystemService(String) 一起使用来查询 android.view.accessibility.CaptioningManager,以获取字幕属性并监听字幕偏好设置的变化。

source

pub const KEYGUARD_SERVICE: &'static str = "keyguard"

与 getSystemService(String) 一起使用来查询用于控制键盘保护的 android.app.KeyguardManager。

source

pub const LOCATION_SERVICE: &'static str = "location"

与 getSystemService(String) 一起使用来查询 android.location.LocationManager 来控制位置更新。

source

pub const COUNTRY_DETECTOR: &'static str = "country_detector"

与 getSystemService(String) 一起使用来查询 android.location.CountryDetector 来检测用户所在的国家/地区。

source

pub const SEARCH_SERVICE: &'static str = "search"

与 getSystemService(String) 一起使用来查询 android.app.SearchManager 来处理搜索。 配置#ui_mode_type_watch不支持android.app.SearchManager。

source

pub const SENSOR_SERVICE: &'static str = "sensor"

与 getSystemService(String) 一起使用来查询用于访问传感器的 android.hardware.SensorManager。

source

pub const SENSOR_PRIVACY_SERVICE: &'static str = "sensor_privacy"

与 getSystemService(String) 一起使用来查询 android.hardware.SensorPrivacyManager,以访问传感器隐私功能。

source

pub const STORAGE_SERVICE: &'static str = "storage"

与 getSystemService(String) 一起使用来查询 android.os.storage.StorageManager 来访问系统存储功能。

source

pub const STORAGE_STATS_SERVICE: &'static str = "storagestats"

与 getSystemService(String) 一起使用来查询 android.app.usage.StorageStatsManager 以访问系统存储统计信息。

source

pub const WALLPAPER_SERVICE: &'static str = "wallpaper"

与 getSystemService(String) 一起使用来查询 com.android.server.WallpaperService 以访问壁纸。

source

pub const VIBRATOR_MANAGER_SERVICE: &'static str = "vibrator_manager"

与 getSystemService(String) 一起使用来查询 android.os.VibratorManager,以访问设备振动器、与单个振动器交互以及在多个振动器上播放同步效果。

source

pub const VIBRATOR_SERVICE: &'static str = "vibrator"

👎Deprecated: 使用 android.os.VibratorManager 来查询默认系统振动器。

与 getSystemService(String) 一起使用来查询 android.os.Vibrator 以便与振动硬件进行交互。

source

pub const STATUS_BAR_SERVICE: &'static str = "statusbar"

与 getSystemService(String) 一起使用来查询 android.app.StatusBarManager,以便与状态栏和快速设置进行交互。

source

pub const CONNECTIVITY_SERVICE: &'static str = "connectivity"

与 getSystemService(String) 一起使用来查询 android.net.ConnectivityManager 来处理网络连接管理。

source

pub const PAC_PROXY_SERVICE: &'static str = "pac_proxy"

与 getSystemService(String) 一起使用来查询 android.net.PacProxyManager,以处理 pac 代理信息的管理。

source

pub const VCN_MANAGEMENT_SERVICE: &'static str = "vcn_management"

与 getSystemService(String) 一起使用来查询用于管理虚拟运营商网络的 android.net.vcn.VcnManager

source

pub const NETD_SERVICE: &'static str = "netd"

与 getSystemService(String) 一起使用来查询 android.net.INetd 以便与网络堆栈进行通信

source

pub const NETWORK_STACK_SERVICE: &'static str = "network_stack"

与 android.os.ServiceManager.getService() 一起使用来查询 INetworkStackConnector IBinder 以便与网络堆栈进行通信

source

pub const TETHERING_SERVICE: &'static str = "tethering"

与 getSystemService(String) 一起使用来查询 android.net.TetheringManager 来管理网络共享功能。

source

pub const IPSEC_SERVICE: &'static str = "ipsec"

与 getSystemService(String) 一起使用来查询 android.net.IpSecManager,以便使用 IPSec 加密套接字或网络。

source

pub const VPN_MANAGEMENT_SERVICE: &'static str = "vpn_management"

与GetSystemService(String)一起查询android.net.VpnManager来管理平台内置VPN的配置文件。

source

pub const CONNECTIVITY_DIAGNOSTICS_SERVICE: &'static str = "connectivity_diagnostics"

与 getSystemService(String) 一起使用来查询 android.net.ConnectivityDiagnosticsManager,以执行网络连接诊断以及从系统接收网络连接信息。

source

pub const TEST_NETWORK_SERVICE: &'static str = "test_network"

与 getSystemService(String) 一起使用来查询 android.net.TestNetworkManager 以构建 TUN 和有限使用网络

source

pub const UPDATE_LOCK_SERVICE: &'static str = "updatelock"

与 getSystemService(String) 一起使用来查询 android.os.IUpdateLock,用于管理不得被无头 OTA 应用程序或类似应用程序中断的运行时序列。

source

pub const NETWORKMANAGEMENT_SERVICE: &'static str = "network_management"

对于内部网络管理服务来说是常量,并不是真正的上下文服务。

source

pub const SLICE_SERVICE: &'static str = "slice"

与 getSystemService(String) 一起使用来查询用于管理切片的 com.android.server.slice.SliceManagerService。

source

pub const NETWORK_STATS_SERVICE: &'static str = "netstats"

与GetSystemService(String)一起查询android.app.usage.NetworkStatsManager进行查询网络使用统计信息。

source

pub const WIFI_SERVICE: &'static str = "wifi"

与 getSystemService(String) 一起使用来查询 android.net.wifi.WifiManager 来处理 Wi-Fi 访问的管理。

source

pub const WIFI_NL80211_SERVICE: &'static str = "wifinl80211"

与 getSystemService(String) 一起使用来查询 android.net.wifi.wificond.WifiNl80211Manager,用于处理 Wi-Fi nl802.11 守护进程(wificond)的管理。 @see android.net.wifi.wificond.WifiNl80211Manager

source

pub const WIFI_P2P_SERVICE: &'static str = "wifip2p"

与 getSystemService(String) 一起使用来查询 android.net.wifi.p2p.WifiP2pManager 来处理 Wi-Fi 对等连接的管理。 @see android.net.wifi.p2p.WifiP2pManager

source

pub const WIFI_AWARE_SERVICE: &'static str = "wifiaware"

与 getSystemService(String) 一起使用来查询 android.net.wifi.aware.WifiAwareManager 来处理 Wi-Fi Aware 的管理。

source

pub const WIFI_SCANNING_SERVICE: &'static str = "wifiscanner"

与 getSystemService(String) 一起使用来查询 android.net.wifi.WifiScanner 以扫描 wifi 世界

source

pub const WIFI_RTT_SERVICE: &'static str = "rttmanager"

👎Deprecated

与 getSystemService(String) 一起使用来查询用于测距 wifi 设备的 android.net.wifi.RttManager

source

pub const WIFI_RTT_RANGING_SERVICE: &'static str = "wifirtt"

与 getSystemService(String) 一起使用来查询用于测量带有 wifi 的设备范围的 android.net.wifi.rtt.WifiRttManager。

source

pub const LOWPAN_SERVICE: &'static str = "lowpan"

与 getSystemService(String) 一起使用来查询 android.net.lowpan.LowpanManager,以处理 LoWPAN 访问的管理。

source

pub const ETHERNET_SERVICE: &'static str = "ethernet"

与 getSystemService(String) 一起使用来查询 android.net.EthernetManager 来处理以太网访问的管理。

source

pub const NSD_SERVICE: &'static str = "servicediscovery"

与 getSystemService(String) 一起使用来查询 android.net.nsd.NsdManager,用于处理网络服务发现的管理

source

pub const AUDIO_SERVICE: &'static str = "audio"

与 getSystemService(String) 一起使用来查询 android.media.AudioManager,用于处理音量、铃声模式和音频路由的管理。

source

pub const AUDIO_DEVICE_VOLUME_SERVICE: &'static str = "audio_device_volume"

与 getSystemService(String) 一起使用来查询 android.media.AudioDeviceVolumeManager,以处理音频设备(例如扬声器、USB 耳机)音量的管理。

source

pub const MEDIA_TRANSCODING_SERVICE: &'static str = "media_transcoding"

与 getSystemService(String) 一起使用来查询 android.media.MediaTranscodingManager 以进行媒体转码。

source

pub const AUTH_SERVICE: &'static str = "auth"

AuthService 负责协调生物特征识别和 PIN/图案/密码身份验证。BiometricService 被拆分为两个服务,AuthService 和 BiometricService,其中 AuthService 是协调所有类型身份验证的高级服务,而 BiometricService 是仅负责生物特征身份验证的下层服务。 理想情况下,我们应该将 BiometricManager 重命名为 AuthManager,因为它在逻辑上与 AuthService 相对应。但是,由于 BiometricManager 是一个公共 API,我们保留了旧名称,但更改了内部实现以使用 AuthService。 截至目前,AUTH_SERVICE 常量仅用于在 SystemServiceRegistry 和 SELinux 中标识服务。要获取 AUTH_SERVICE 的管理器,应使用 BIOMETRIC_SERVICE 和 getSystemService(String) 来检索 android.hardware.biometrics.BiometricManager 两个服务及其管理器的映射: Service | Manager AuthService BiometricManager BiometricService N/A

source

pub const FINGERPRINT_SERVICE: &'static str = "fingerprint"

与 getSystemService(String) 一起使用来查询 android.hardware.fingerprint.FingerprintManager 来处理指纹管理。

source

pub const FACE_SERVICE: &'static str = "face"

与 getSystemService(String) 一起使用来查询 android.hardware.face.FaceManager 来处理面部身份验证的管理。

source

pub const IRIS_SERVICE: &'static str = "iris"

与 getSystemService(String) 一起使用来查询 android.hardware.iris.IrisManager,用于处理虹膜认证的管理。

source

pub const BIOMETRIC_SERVICE: &'static str = "biometric"

与 getSystemService(String) 一起使用来查询 android.hardware.biometrics.BiometricManager,用于处理生物识别和 PIN/模式/密码身份验证。

source

pub const MEDIA_COMMUNICATION_SERVICE: &'static str = "media_communication"

与 getSystemService(String) 一起使用来查询用于管理 android.media.MediaSession2 的 android.media.MediaCommunicationManager。

source

pub const MEDIA_ROUTER_SERVICE: &'static str = "media_router"

与getSystemService一起查询android.media.MediaRouter来控制和管理媒体路由。

source

pub const MEDIA_SESSION_SERVICE: &'static str = "media_session"

与 getSystemService(String) 一起使用来查询 android.media.session.MediaSessionManager 来管理媒体会话。

source

pub const TELEPHONY_SERVICE: &'static str = "phone"

与 getSystemService(String) 一起使用来查询 android.telephony.TelephonyManager,用于处理设备的电话功能管理。

source

pub const TELEPHONY_SUBSCRIPTION_SERVICE: &'static str = "telephony_subscription_service"

与 getSystemService(String) 一起使用来查询 android.telephony.SubscriptionManager,以处理设备的电话订阅管理。

source

pub const TELECOM_SERVICE: &'static str = "telecom"

与 getSystemService(String) 一起使用来查询 android.telecom.TelecomManager 来管理设备的电信相关功能。

source

pub const CARRIER_CONFIG_SERVICE: &'static str = "carrier_config"

与 getSystemService(String) 一起使用来查询 android.telephony.CarrierConfigManager,以读取运营商配置值。

source

pub const EUICC_SERVICE: &'static str = "euicc"

与 getSystemService(String) 一起使用来查询 android.telephony.euicc.EuiccManager 来管理设备 eUICC(嵌入式 SIM)。

source

pub const EUICC_CARD_SERVICE: &'static str = "euicc_card"

与GetSystemService(String)一起查询android.telephony.euicc.EuiccCardManager访问设备EUICC(嵌入式SIM)。

source

pub const MMS_SERVICE: &'static str = "mms"

与 getSystemService(String) 一起使用来查询 android.telephony.MmsManager 来发送/接收 MMS 消息。

source

pub const CLIPBOARD_SERVICE: &'static str = "clipboard"

与 getSystemService(String) 一起使用来查询 android.content.ClipboardManager,以访问和修改全局剪贴板的内容。

source

pub const TEXT_CLASSIFICATION_SERVICE: &'static str = "textclassification"

与 getSystemService(String) 一起使用来查询用于文本分类服务的 TextClassificationManager。

source

pub const SELECTION_TOOLBAR_SERVICE: &'static str = "selection_toolbar"

与GetSystemService(String)一起查询android.view.selectiontoolbar.SelectionToolBarmanager进行选择工具栏服务。

source

pub const FONT_SERVICE: &'static str = "font"

与 getSystemService(String) 一起使用来查询字体服务的 android.graphics.fonts.FontManager。

source

pub const ATTENTION_SERVICE: &'static str = "attention"

与 getSystemService(String) 一起使用来查询 com.android.server.attention.AttentionManagerService 以获得注意服务。

source

pub const ROTATION_RESOLVER_SERVICE: &'static str = "resolver"

(内部) 旋转解析器服务的官方发布名称。 // TODO(b/178151184): 释放前,将其更改为旋转解析器。

source

pub const INPUT_METHOD_SERVICE: &'static str = "input_method"

与 getSystemService(String) 一起使用来查询 android.view.inputmethod.InputMethodManager 来访问输入法。

source

pub const TEXT_SERVICES_MANAGER_SERVICE: &'static str = "textservices"

与 getSystemService(String) 一起使用来查询 android.view.textservice.TextServicesManager 来访问文本服务。

source

pub const APPWIDGET_SERVICE: &'static str = "appwidget"

与 getSystemService(String) 一起使用来查询 android.appwidget.AppWidgetManager 来访问 AppWidgets。

source

pub const VOICE_INTERACTION_MANAGER_SERVICE: &'static str = "voiceinteraction"

(内部)语音交互管理器服务的官方发布名称。

source

pub const AUTOFILL_MANAGER_SERVICE: &'static str = "autofill"

(内部)自动填充服务的官方出版名称。

source

pub const TEXT_TO_SPEECH_MANAGER_SERVICE: &'static str = "texttospeech"

(内部)文本到语音管理服务的官方发布名称。

source

pub const CONTENT_CAPTURE_MANAGER_SERVICE: &'static str = "content_capture"

内容捕获服务的官方发布名称。

source

pub const TRANSLATION_MANAGER_SERVICE: &'static str = "translation"

翻译服务的官方出版名称。

source

pub const UI_TRANSLATION_SERVICE: &'static str = "ui_translation"

支持ui翻译功能的翻译服务的官方发布名称。

source

pub const CONTENT_SUGGESTIONS_SERVICE: &'static str = "content_suggestions"

用于获取任务快照的内容选择和分类。

source

pub const APP_PREDICTION_SERVICE: &'static str = "app_prediction"

应用程序预测服务的官方发布名称。 注意:此服务是可选的;“ ”的调用者。

source

pub const SEARCH_UI_SERVICE: &'static str = "search_ui"

搜索 UI 服务的官方发布名称。 注意:此服务是可选的;“ ”的调用者。

source

pub const SMARTSPACE_SERVICE: &'static str = "smartspace"

用于获取智能空间服务。 注意:此服务是可选的;“ ”的调用者。

source

pub const CLOUDSEARCH_SERVICE: &'static str = "cloudsearch"

用于获取云搜索服务。 注意:此服务是可选的;“ ”的调用者。

source

pub const SOUND_TRIGGER_SERVICE: &'static str = "soundtrigger"

与 getSystemService(String) 一起使用来访问 com.android.server.voiceinteraction.SoundTriggerService。

source

pub const SOUND_TRIGGER_MIDDLEWARE_SERVICE: &'static str = "soundtrigger_middleware"

与 getSystemService(String) 一起使用来访问 com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareService。

source

pub const WALLPAPER_EFFECTS_GENERATION_SERVICE: &'static str = "wallpaper_effects_generation"

用于获取壁纸效果生成服务。 注意:此服务是可选的;“ ”的调用者。

source

pub const MUSIC_RECOGNITION_SERVICE: &'static str = "music_recognition"

用于访问MusicRecognitionManagerService。

source

pub const PERMISSION_SERVICE: &'static str = "permission"

(内部)许可服务的官方出版名称。

source

pub const LEGACY_PERMISSION_SERVICE: &'static str = "legacy_permission"

旧版(内部)权限服务的官方发布名称。

source

pub const PERMISSION_CONTROLLER_SERVICE: &'static str = "permission_controller"

(内部)权限控制器服务的官方发布名称。

source

pub const PERMISSION_CHECKER_SERVICE: &'static str = "permission_checker"

(内部)权限检查服务的官方发布名称。

source

pub const PERMISSION_ENFORCER_SERVICE: &'static str = "permission_enforcer"

(内部) 权限执行服务的官方发布名称。

source

pub const APP_HIBERNATION_SERVICE: &'static str = "app_hibernation"

与 getSystemService(String) 一起使用来查询 android.apphibernation.AppHibernationManager 以便与休眠服务进行通信。

source

pub const BACKUP_SERVICE: &'static str = "backup"

与 getSystemService(String) 一起使用来查询 android.app.backup.IBackupManager IBackupManager 以便与备份机制进行通信。

source

pub const ROLLBACK_SERVICE: &'static str = "rollback"

与 getSystemService(String) 一起使用来查询 android.content.rollback.RollbackManager 以便与回滚管理器进行通信

source

pub const REBOOT_READINESS_SERVICE: &'static str = "reboot_readiness"

与 getSystemService(String) 一起使用来查询 android.scheduling.RebootReadinessManager,以便与重启准备就绪检测器进行通信。

source

pub const DROPBOX_SERVICE: &'static str = "dropbox"

与 getSystemService(String) 一起使用来查询用于记录诊断日志的 android.os.DropBoxManager 实例。

source

pub const BACKGROUND_INSTALL_CONTROL_SERVICE: &'static str = "background_install_control"

BackgroundInstallControlService 的系统服务名称。此服务负责监督设备上的 MBA 并提供 MBA 的相关元数据。

source

pub const BINARY_TRANSPARENCY_SERVICE: &'static str = "transparency"

BinaryTransparencyService 的系统服务名称。它用于查询与设备上各种预安装和系统二进制文件有关的测量值,以便为用户提供透明度。

source

pub const DEVICE_IDLE_CONTROLLER: &'static str = "deviceidle"

DeviceIdleManager 的系统服务名称。

source

pub const POWER_WHITELIST_MANAGER: &'static str = "power_whitelist"

👎Deprecated

PowerWhitelistManager 的系统服务名称。

source

pub const POWER_EXEMPTION_SERVICE: &'static str = "power_exemption"

PowerExemptionManager 的系统服务名称。

source

pub const DEVICE_POLICY_SERVICE: &'static str = "device_policy"

与 getSystemService(String) 一起使用来查询 android.app.admin.DevicePolicyManager 来进行全局设备策略管理。

source

pub const UI_MODE_SERVICE: &'static str = "uimode"

与 getSystemService(String) 一起使用来查询用于控制 UI 模式的 android.app.UiModeManager。

source

pub const DOWNLOAD_SERVICE: &'static str = "download"

与 getSystemService(String) 一起使用来查询 android.app.DownloadManager 以请求 HTTP 下载。

source

pub const BATTERY_SERVICE: &'static str = "batterymanager"

与 getSystemService(String) 一起使用来查询 android.os.BatteryManager 来管理电池状态。

source

pub const NFC_SERVICE: &'static str = "nfc"

与 getSystemService(String) 一起使用来查询 android.nfc.NfcManager 以使用 NFC。

source

pub const BLUETOOTH_SERVICE: &'static str = "bluetooth"

与 getSystemService(String) 一起使用来查询 android.bluetooth.BluetoothManager 以使用蓝牙。

source

pub const SIP_SERVICE: &'static str = "sip"

与GetSystemService(String)一起查询android.net.sip.SipManager访问SIP相关服务。

source

pub const USB_SERVICE: &'static str = "usb"

与 getSystemService(String) 一起使用来查询 android.hardware.usb.UsbManager,以访问 USB 设备(作为 USB 主机)并控制此设备作为 USB 设备的行为。

source

pub const ADB_SERVICE: &'static str = "adb"

与 getSystemService 一起使用来查询 android.debug.AdbManager 以访问 ADB 调试功能。

source

pub const SERIAL_SERVICE: &'static str = "serial"

与 getSystemService(String) 一起使用来查询 android.hardware.SerialManager 来访问串行端口。

source

pub const HDMI_CONTROL_SERVICE: &'static str = "hdmi_control"

与 getSystemService(String) 一起使用来查询 android.hardware.hdmi.HdmiControlManager 来控制和管理 HDMI-CEC 协议。

source

pub const INPUT_SERVICE: &'static str = "input"

与 getSystemService(String) 一起使用来查询 android.hardware.input.InputManager 以便与输入设备交互。

source

pub const DISPLAY_SERVICE: &'static str = "display"

与 getSystemService(String) 一起使用来查询 android.hardware.display.DisplayManager 以便与显示设备交互。

source

pub const COLOR_DISPLAY_SERVICE: &'static str = "color_display"

与 getSystemService(String) 一起使用来查询 android.hardware.display.ColorDisplayManager 来控制颜色转换。

source

pub const USER_SERVICE: &'static str = "user"

与 getSystemService(String) 一起使用来查询 android.os.UserManager,以便在支持多用户的设备上管理用户。

source

pub const LAUNCHER_APPS_SERVICE: &'static str = "launcherapps"

与 getSystemService(String) 一起使用来查询 android.content.pm.LauncherApps,以便查询和监控用户配置文件中可启动的应用程序。

source

pub const RESTRICTIONS_SERVICE: &'static str = "restrictions"

与 getSystemService(String) 一起使用来查询 android.content.RestrictionsManager,以查询应用程序限制并请求受限操作的权限。

source

pub const APP_OPS_SERVICE: &'static str = "appops"

与GetSystemService(String)一起查询android.app.AppopsManager,以跟踪设备上的应用程序操作。

source

pub const ROLE_SERVICE: &'static str = "role"

与 getSystemService(String) 一起使用来查询用于管理角色的 android.app.role.RoleManager。

source

pub const CAMERA_SERVICE: &'static str = "camera"

与 getSystemService(String) 一起使用来查询 android.hardware.camera2.CameraManager 以便与相机设备交互。 @see android.hardware.camera2.CameraManager

source

pub const PRINT_SERVICE: &'static str = "print"

android.print.PrintManager用于打印和管理打印机和打印任务。

source

pub const COMPANION_DEVICE_SERVICE: &'static str = "companiondevice"

与 getSystemService(String) 一起使用来查询 android.companion.CompanionDeviceManager 来管理配套设备

source

pub const VIRTUAL_DEVICE_SERVICE: &'static str = "virtualdevice"

与 getSystemService(String) 一起使用来查询用于管理虚拟设备的 android.companion.virtual.VirtualDeviceManager。 在没有 PackageManager#FEATURE_COMPANION_DEVICE_SETUP 系统功能的设备上,getSystemService(String) 将返回“ ”.

source

pub const CONSUMER_IR_SERVICE: &'static str = "consumer_ir"

与 getSystemService(String) 一起使用来查询 android.hardware.ConsumerIrManager,以便从设备传输红外信号。

source

pub const TRUST_SERVICE: &'static str = "trust"

android.app.trust.TrustManager 用于管理信任代理。

source

pub const TV_INTERACTIVE_APP_SERVICE: &'static str = "tv_interactive_app"

与 getSystemService(String) 一起使用来查询 android.media.tv.interactive.TvInteractiveAppManager,以便与设备上的电视交互应用程序进行交互。

source

pub const TV_INPUT_SERVICE: &'static str = "tv_input"

与 getSystemService(String) 一起使用来查询 android.media.tv.TvInputManager,以便与设备上的电视输入进行交互。

source

pub const TV_TUNER_RESOURCE_MGR_SERVICE: &'static str = "tv_tuner_resource_mgr"

与 getSystemService(String) 一起使用来查询 android.media.tv.TunerResourceManager,以便与设备上的电视调谐器资源进行交互。

source

pub const NETWORK_SCORE_SERVICE: &'static str = "network_score"

👎Deprecated: 请参阅 Wi-Fi 建议 API 来了解建议 WiFi 网络的替代 API。

android.net.NetworkScoreManager 用于管理网络得分。

source

pub const USAGE_STATS_SERVICE: &'static str = "usagestats"

与 getSystemService(String) 一起使用来查询 android.app.usage.UsageStatsManager 来查询设备使用情况统计信息。

source

pub const JOB_SCHEDULER_SERVICE: &'static str = "jobscheduler"

与GetSystemService(String)一起查询android.app.job.JobScheduler实例,以管理偶尔的背景任务。

source

pub const RESOURCE_ECONOMY_SERVICE: &'static str = "tare"

与 getSystemService(String) 一起使用来查询 android.app.tare.EconomyManager 实例以了解经济状况。

source

pub const PERSISTENT_DATA_BLOCK_SERVICE: &'static str = "persistent_data_block"

与GetSystemService(String)一起查询android.service.persistentdata.PersistentDatablockManager实例,以与跨工厂重置的存储设备进行交互。

source

pub const OEM_LOCK_SERVICE: &'static str = "oem_lock"

与 getSystemService(String) 一起使用来查询用于管理 OEM 锁的 android.service.oemlock.OemLockManager 实例。

source

pub const MEDIA_PROJECTION_SERVICE: &'static str = "media_projection"

与 getSystemService(String) 一起使用来查询用于管理媒体投影会话的 android.media.projection.MediaProjectionManager 实例。

source

pub const MIDI_SERVICE: &'static str = "midi"

与 getSystemService(String) 一起使用来查询 android.media.midi.MidiManager 来访问 MIDI 服务。

source

pub const RADIO_SERVICE: &'static str = "broadcastradio"

与 getSystemService(String) 一起使用来查询 android.hardware.radio.RadioManager 以访问广播电台服务。

source

pub const HARDWARE_PROPERTIES_SERVICE: &'static str = "hardware_properties"

与 getSystemService(String) 一起使用来查询 android.os.HardwarePropertiesManager 来访问硬件属性服务。

source

pub const THERMAL_SERVICE: &'static str = "thermalservice"

与 getSystemService(String) 一起使用来查询 android.os.ThermalService 以访问热服务。

source

pub const PERFORMANCE_HINT_SERVICE: &'static str = "performance_hint"

与 getSystemService(String) 一起使用来查询 android.os.PerformanceHintManager 以访问性能提示服务。

source

pub const SHORTCUT_SERVICE: &'static str = "shortcut"

与 getSystemService(String) 一起使用来查询 android.content.pm.ShortcutManager 以访问启动器快捷方式服务。

source

pub const CONTEXTHUB_SERVICE: &'static str = "contexthub"

与 getSystemService(String) 一起使用来查询 android.hardware.location.ContextHubManager 来访问上下文中心。

source

pub const SYSTEM_HEALTH_SERVICE: &'static str = "systemhealth"

与 getSystemService(String) 一起使用来查询 android.os.health.SystemHealthManager,以访问系统健康(电池、电源、内存等)指标。

source

pub const GATEKEEPER_SERVICE: &'static str = "android.service.gatekeeper.IGateKeeperService"

守门人 服务。

source

pub const DEVICE_IDENTIFIERS_SERVICE: &'static str = "device_identifiers"

定义访问设备标识符的策略的服务。

source

pub const INCIDENT_SERVICE: &'static str = "incident"

报告系统健康“事件”的服务

source

pub const INCIDENT_COMPANION_SERVICE: &'static str = "incidentcompanion"

协助 incident 和 dumpstated 向用户报告状态并确认授权进行事件报告或错误报告的服务

source

pub const STATS_MANAGER_SERVICE: &'static str = "statsmanager"

协助位于系统服务器中的 android.app.StatsManager 的服务。

source

pub const STATS_COMPANION_SERVICE: &'static str = "statscompanion"

协助 statsd 获取一般统计数据的服务。

source

pub const STATS_BOOTSTRAP_ATOM_SERVICE: &'static str = "statsbootstrap"

协助 statsd 从引导原子记录原子的服务。

source

pub const STATS_MANAGER: &'static str = "stats"

与 getSystemService(String) 一起使用来查询 android.app.StatsManager。

source

pub const PLATFORM_COMPAT_SERVICE: &'static str = "platform_compat"

与 android.os.ServiceManager.getService() 一起使用来查询 IPlatformCompat IBinder,以便与平台兼容服务进行通信。

source

pub const PLATFORM_COMPAT_NATIVE_SERVICE: &'static str = "platform_compat_native"

与 android.os.ServiceManager.getService() 一起使用来查询与平台兼容服务通信的本机代码的 IPlatformCompatNative IBinder。

source

pub const BUGREPORT_SERVICE: &'static str = "bugreport"

用于捕获错误报告的服务。

source

pub const OVERLAY_SERVICE: &'static str = "overlay"

与 getSystemService(String) 一起使用来查询用于管理覆盖包的 android.content.om.OverlayManager。

source

pub const RESOURCES_SERVICE: &'static str = "resources"

与 getSystemService(String) 一起使用来管理资源。

source

pub const IDMAP_SERVICE: &'static str = "idmap"

与 getSystemService(String) 一起使用来查询 android.os.IIdmap2 来管理 idmap 文件(由覆盖包使用)。

source

pub const VR_SERVICE: &'static str = "vrmanager"

与 getSystemService(String) 一起使用来查询用于访问 VR 服务的 VrManager。

source

pub const CROSS_PROFILE_APPS_SERVICE: &'static str = "crossprofileapps"

与 getSystemService(String) 一起使用来查询 android.content.pm.CrossProfileApps 以进行跨配置文件操作。

source

pub const SECURE_ELEMENT_SERVICE: &'static str = "secure_element"

与 getSystemService 一起使用来查询 android.se.omapi.ISecureElementService 以访问 SecureElementService。

source

pub const TIME_DETECTOR_SERVICE: &'static str = "time_detector"

与 getSystemService(String) 一起使用来查询 android.app.timedetector.TimeDetector。

source

pub const TIME_ZONE_DETECTOR_SERVICE: &'static str = "time_zone_detector"

与 getSystemService(String) 一起使用来查询 android.app.timezonedetector.TimeZoneDetector。

source

pub const TIME_MANAGER_SERVICE: &'static str = "time_manager"

与 getSystemService(String) 一起使用来查询 TimeManager。

source

pub const APP_BINDING_SERVICE: &'static str = "app_binding"

AppBindingService 的 Binder 服务名称。

source

pub const TELEPHONY_IMS_SERVICE: &'static str = "telephony_ims"

与 getSystemService(String) 一起使用来查询 android.telephony.ims.ImsManager。

source

pub const SYSTEM_CONFIG_SERVICE: &'static str = "system_config"

与 getSystemService(String) 一起使用来查询 android.os.SystemConfigManager。

source

pub const TELEPHONY_RCS_MESSAGE_SERVICE: &'static str = "ircsmessage"

与 getSystemService(String) 一起使用来查询 android.telephony.ims.RcsMessageManager。

source

pub const DYNAMIC_SYSTEM_SERVICE: &'static str = "dynamic_system"

与 getSystemService(String) 一起使用来查询 android.os.image.DynamicSystemManager。

source

pub const BLOB_STORE_SERVICE: &'static str = "blob_store"

与 getSystemService(String) 一起使用来查询 android.app.blob.BlobStoreManager,以便从系统维护的 Blob 存储中贡献和访问数据 Blob。

source

pub const TELEPHONY_REGISTRY_SERVICE: &'static str = "telephony_registry"

与 getSystemService(String) 一起使用来查询 TelephonyRegistryManager。

source

pub const BATTERY_STATS_SERVICE: &'static str = "batterystats"

与 getSystemService(String) 一起使用来查询 android.os.BatteryStatsManager。

source

pub const APP_SEARCH_SERVICE: &'static str = "app_search"

与 getSystemService(String) 一起使用来查询 android.app.appsearch.AppSearchManager,以便索引和查询系统管理的应用程序数据。

source

pub const APP_INTEGRITY_SERVICE: &'static str = "app_integrity"

与 getSystemService(String) 一起使用来查询 android.content.integrity.AppIntegrityManager。

source

pub const DATA_LOADER_MANAGER_SERVICE: &'static str = "dataloader_manager"

与 getSystemService(String) 一起使用来查询 android.content.pm.DataLoaderManager。

source

pub const INCREMENTAL_SERVICE: &'static str = "incremental"

与 getSystemService(String) 一起使用来查询 android.os.incremental.IncrementalManager。

source

pub const ATTESTATION_VERIFICATION_SERVICE: &'static str = "attestation_verification"

与 getSystemService(String) 一起使用来查询 android.security.attestationverification.AttestationVerificationManager。

source

pub const FILE_INTEGRITY_SERVICE: &'static str = "file_integrity"

与 getSystemService(String) 一起使用来查询 android.security.FileIntegrityManager。

source

pub const REMOTE_PROVISIONING_SERVICE: &'static str = "remote_provisioning"

用于远程密钥配置的绑定服务。

source

pub const LIGHTS_SERVICE: &'static str = "lights"

与 getSystemService(String) 一起使用来查询用于控制设备灯的 android.hardware.lights.LightsManager。

source

pub const UWB_SERVICE: &'static str = "uwb"

与 getSystemService(String) 一起使用来查询 android.uwb.UwbManager。

source

pub const DREAM_SERVICE: &'static str = "dream"

与 getSystemService(String) 一起使用来查询用于控制梦境状态的 android.app.DreamManager。

source

pub const SMS_SERVICE: &'static str = "sms"

与 getSystemService(String) 一起使用来查询 android.telephony.SmsManager 来访问短信功能。

source

pub const PEOPLE_SERVICE: &'static str = "people"

与 getSystemService(String) 一起使用来访问 PeopleManager 来与您发布的对话进行交互。

source

pub const DEVICE_STATE_SERVICE: &'static str = "device_state"

与 getSystemService(String) 一起使用来访问设备状态服务。

source

pub const MEDIA_METRICS_SERVICE: &'static str = "media_metrics"

与 getSystemService(String) 一起使用来查询 android.media.metrics.MediaMetricsManager,以便与设备上的媒体指标进行交互。

source

pub const SPEECH_RECOGNITION_SERVICE: &'static str = "speech_recognition"

与 getSystemService(String) 一起使用来访问系统语音识别服务。

source

pub const GAME_SERVICE: &'static str = "game"

与 getSystemService(String) 一起使用来查询 GameManager。

source

pub const DOMAIN_VERIFICATION_SERVICE: &'static str = "domain_verification"

与 getSystemService(String) 一起使用来访问 android.content.pm.verify.domain.DomainVerificationManager 来查询已声明的 Web 域的批准和用户状态。

source

pub const DISPLAY_HASH_SERVICE: &'static str = "display_hash"

与 getSystemService(String) 一起使用来访问 android.view.displayhash.DisplayHashManager 来处理显示哈希。

source

pub const LOCALE_SERVICE: &'static str = "locale"

与 getSystemService(String) 一起使用来查询 android.app.LocaleManager。

source

pub const SAFETY_CENTER_SERVICE: &'static str = "safety_center"

与 getSystemService(String) 一起使用来查询 android.safetycenter.SafetyCenterManager 实例,以便与安全中心进行交互。

source

pub const NEARBY_SERVICE: &'static str = "nearby"

与 getSystemService(String) 一起使用来查询 android.nearby.NearbyManager 来发现附近的设备。

source

pub const AMBIENT_CONTEXT_SERVICE: &'static str = "ambient_context"

与 getSystemService(String) 一起使用来查询 android.app.ambientcontext.AmbientContextManager。

source

pub const WEARABLE_SENSING_SERVICE: &'static str = "wearable_sensing"

与 getSystemService(String) 一起使用来查询 android.app.wearable.WearableSensingManager。

source

pub const HEALTHCONNECT_SERVICE: &'static str = "healthconnect"

与GetSystemService(String)一起查询android.health.connect.HealthConnectManager。

source

pub const CREDENTIAL_SERVICE: &'static str = "credential"

与 getSystemService(String) 一起使用来查询 android.credentials.CredentialManager 来向您的应用程序验证用户身份。

source

pub const DEVICE_LOCK_SERVICE: &'static str = "device_lock"

与 getSystemService(String) 一起使用来查询 android.devicelock.DeviceLockManager。

source

pub const VIRTUALIZATION_SERVICE: &'static str = "virtualization"

与 getSystemService(String) 一起使用来查询 android.system.virtualmachine.VirtualMachineManager。 在没有 PackageManager#FEATURE_VIRTUALIZATION_FRAMEWORK 系统功能的设备上,getSystemService(String) 将返回“ ”。

source

pub const GRAMMATICAL_INFLECTION_SERVICE: &'static str = "grammatical_inflection"

与 getSystemService(String) 一起使用来查询 GrammaticalInflectionManager。

source

pub const SATELLITE_SERVICE: &'static str = "satellite"

与 getSystemService(String) 一起使用来查询 android.telephony.satellite.SatelliteManager 来访问卫星功能。

source

pub const SHARED_CONNECTIVITY_SERVICE: &'static str = "shared_connectivity"

与 getSystemService(String) 一起使用来查询 android.net.wifi.sharedconnectivity.app.SharedConnectivityManager 来访问共享连接服务。

source

pub fn get_class_loader(&self) -> ClassLoader

  • 返回可用于查询此包中的类的类加载器。
source

pub fn send_broadcast(&self, intent: &Intent)

  • 将给定的意图广播给所有感兴趣的 BroadcastReceiver。此调用是异步的;它会立即返回,您将在接收器运行时继续执行。接收器不会传播任何结果,接收器也无法中止广播。如果您想允许接收器传播结果或中止广播,则必须使用 sendOrderedBroadcast(Intent, String) 发送有序广播。有关 Intent 广播的更多信息,请参阅 BroadcastReceiver。
  • intent 要广播的 Intent;与此 Intent 匹配的所有接收器都将收到广播。
source

pub fn start_activity(&self, intent: &Intent)

  • 与 startActivity(Intent, Bundle) 相同,但未指定任何选项。
  • intent 要启动的活动的描述。
  • 抛出:ActivityNotFoundException – `
source

pub fn get_package_name(&self) -> String

  • 返回此应用程序包的名称。
source

pub fn get_base_package_name(&self) -> String

  • 返回此上下文所派生自的基础上下文的名称。这与 getOpPackageName() 相同,除非系统组件加载到其他应用进程中,在这种情况下 getOpPackageName() 将是该进程中主软件包的名称(以便应用操作 uid 验证可以使用该名称)。
source

pub fn get_op_package_name(&self) -> String

  • 返回应用于此上下文中的 android.app.AppOpsManager 调用的包名称,以便 app ops manager 的 uid 验证可以使用该名称。这通常不适用于第三方应用程序开发人员。
source

pub fn get_attribution_tag(&self) -> Option<String>

  • 归因可用于复杂的应用中,以在逻辑上区分应用的各个部分。例如,博客应用可能还内置有即时通讯应用。在这种情况下,每个子功能可以使用两个单独的标签。
  • 返回:此上下文所针对的归因标签,如果这是默认标签,则返回 null。
source

pub fn get_package_resource_path(&self) -> String

  • 返回此上下文的主要 Android 包的完整路径。Android 包是一个 ZIP 文件,其中包含应用程序的主要资源。注意:这通常对应用程序没有用,因为它们不应直接访问文件系统。
  • 返回:String 资源路径。
source

pub fn get_package_code_path(&self) -> String

  • 返回此上下文的主要 Android 包的完整路径。Android 包是一个 ZIP 文件,其中包含应用程序的主要代码和资产。
  • 注意:这通常对应用程序没有用,因为它们不应直接访问文件系统。
  • 返回:String 代码和资产的路径。
source

pub fn get_system_service(&self, name: String) -> Option<Object>

  • 按名称返回系统级服务的句柄。返回对象的类因请求的名称而异。当前可用的名称为:
  • WINDOW_SERVICE (“window”)
  • 您可以在顶级窗口管理器中放置自定义窗口。返回的对象是 WindowManager。只能从可视上下文(例如 Activity 或使用 createWindowContext(int, Bundle) 创建的上下文)中获取,这些上下文会根据屏幕区域的配置和可视边界进行调整。
  • LAYOUT_INFLATER_SERVICE (“layout_inflater”)
  • android.view.LayoutInflater 用于在此上下文中填充布局资源。只能从可视上下文(例如 Activity 或使用 createWindowContext(int, Bundle) 创建的上下文)获取,这些上下文会根据屏幕区域的配置和可视边界进行调整。
  • ACTIVITY_SERVICE (“activity”)
  • 用于与系统全局活动状态交互的 ActivityManager。
  • WALLPAPER_SERVICE (“wallpaper”)
  • android.service.wallpaper.WallpaperService 用于在此上下文中访问壁纸。只能从可视上下文(例如 Activity 或使用 createWindowContext(int, Bundle) 创建的上下文)获取,这些上下文会根据屏幕区域的配置和可视边界进行调整。
  • POWER_SERVICE (“power”)
  • 一个用于控制电源管理的android.os.PowerManager。
  • ALARM_SERVICE (“alarm”)
  • 一个 Android 应用程序 AlarmManager,用于在您选择的时间接收意图。
  • NOTIFICATION_SERVICE (“notification”)
  • android.app.NotificationManager,用于通知用户后台事件。
  • KEYGUARD_SERVICE (“keyguard”)
  • 一个用于控制键盘锁的 android.app.KeyguardManager。
  • LOCATION_SERVICE (“location”)
  • android.location.LocationManager 用于控制位置(例如 GPS)更新。
  • SEARCH_SERVICE (“search”)
  • 一个用于处理搜索的android.app.SearchManager。
  • VIBRATOR_MANAGER_SERVICE (“vibrator_manager”)
  • android.os.VibratorManager,用于访问设备振动器、与各个振动器交互以及在多个振动器上播放同步效果。
  • VIBRATOR_SERVICE (“vibrator”)
  • 一个android.os.Vibrator,用于与振动器硬件进行交互。
  • CONNECTIVITY_SERVICE (“connectivity”)
  • 用于处理网络连接管理的 ConnectivityManager。
  • IPSEC_SERVICE (“ipsec”)
  • IpSecManager 用于管理套接字和网络上的 IPSec。
  • WIFI_SERVICE (“wifi”)
  • 用于管理 Wi-Fi 连接的 WifiManager。在 Android 7 之前的版本中,应仅从应用上下文中获取它,而不能从任何其他派生上下文中获取它,以避免调用过程中出现内存泄漏。
  • WIFI_AWARE_SERVICE (“wifiaware”)
  • WifiAwareManager 用于管理 Wi-Fi Aware 发现和连接。
  • WIFI_P2P_SERVICE (“wifip2p”)
  • WifiP2pManager 用于管理 Wi-Fi Direct 连接。
  • INPUT_METHOD_SERVICE (“input_method”)
  • 用于管理输入方法的 InputMethodManager。
  • UI_MODE_SERVICE (“uimode”)
  • 一个用于控制 UI 模式的 android.app.UiModeManager。
  • DOWNLOAD_SERVICE (“download”)
  • 用于请求 HTTP 下载的 android.app.DownloadManager
  • BATTERY_SERVICE (“batterymanager”)
  • 用于管理电池状态的 android.os.BatteryManager
  • JOB_SCHEDULER_SERVICE (“taskmanager”)
  • 一个用于管理计划任务的android.app.job.JobScheduler
  • NETWORK_STATS_SERVICE (“netstats”)
  • 用于查询网络使用情况统计数据的 NetworkStatsManager。
  • HARDWARE_PROPERTIES_SERVICE (“hardware_properties”)
  • 用于访问硬件属性的 android.os.HardwarePropertiesManager。
  • DOMAIN_VERIFICATION_SERVICE (“domain_verification”)
  • android.content.pm.verify.domain.DomainVerificationManager,用于访问 Web 域批准状态。
  • DISPLAY_HASH_SERVICE (“display_hash”)
  • android.view.displayhash.DisplayHashManager 用于管理显示哈希。
  • 注意:通过此 API 获取的系统服务可能与获取它们的上下文密切相关。一般来说,不要在各种不同的上下文(活动、应用程序、服务、提供商等)之间共享服务对象。
  • 注意:PackageManager.isInstantApp() 返回 true 的免安装应用无法访问以下系统服务:DEVICE_POLICY_SERVICE、FINGERPRINT_SERVICE、KEYGUARD_SERVICE、SHORTCUT_SERVICE、USB_SERVICE、WALLPAPER_SERVICE、WIFI_P2P_SERVICE、WIFI_SERVICE、WIFI_AWARE_SERVICE。对于这些服务,此方法将返回 null。通常,如果您以免安装应用的形式运行,则应始终检查此方法的结果是否为 null。
  • 注意:在实现此方法时,请记住可以在较新的 Android 版本中添加新服务,因此如果您只是在寻找上面提到的明确名称,请确保在您无法识别该名称时返回 null — 如果您抛出 RuntimeException 异常,您的应用可能会在新的 Android 版本上中断。
  • 返回:如果名称不存在则返回 null。
  • name 所需服务的名称。

Methods from Deref<Target = GlobalRef>§

source

pub fn as_obj(&self) -> &JObject<'static>

Get the object from the global ref

This borrows the ref and prevents it from being dropped as long as the JObject sticks around.

Methods from Deref<Target = JObject<'static>>§

source

pub fn as_raw(&self) -> *mut _jobject

Returns the raw JNI pointer.

Trait Implementations§

source§

impl Debug for Context

source§

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

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

impl Deref for Context

§

type Target = GlobalRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<&Activity> for Context

source§

fn from(value: &Activity) -> Self

Converts to this type from the input type.
source§

impl From<&GlobalRef> for Context

source§

fn from(obj: &GlobalRef) -> Self

Converts to this type from the input type.
source§

impl Into<GlobalRef> for &Context

source§

fn into(self) -> GlobalRef

Converts this type into the (usually inferred) input type.
source§

impl JObjNew for Context

§

type Fields = ()

字段类型
source§

fn _new(this: &GlobalRef, fields: Self::Fields) -> Self

从java对象创建本地对象。 this java对象引用。
source§

fn null() -> Self
where Self: Sized, Self::Fields: Default,

创建空对象。
source§

impl JObjRef for Context

source§

fn java_ref(&self) -> GlobalRef

获取java对象引用。
source§

impl JType for Context

§

type Error = Error

错误类型。
source§

const CLASS: &'static str = "android/content/Context"

java类的名称。
source§

const OBJECT_SIG: &'static str = "Landroid/content/Context;"

对象的签名描述。
source§

impl PartialEq for Context

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToString for Context

source§

fn to_string(&self) -> String

Converts the given value to a String. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.