pub struct LAEnvironment { /* private fields */ }Expand description
Managed wrapper around Apple’s LAEnvironment.
Implementations§
Source§impl LAEnvironment
impl LAEnvironment
Sourcepub fn current_user() -> Result<Self>
pub fn current_user() -> Result<Self>
The current user’s authentication environment.
§Errors
Returns an error if the macOS 15 environment APIs are unavailable or the Swift bridge rejects the request.
Sourcepub fn state(&self) -> Result<LAEnvironmentState>
pub fn state(&self) -> Result<LAEnvironmentState>
Snapshot the current environment state.
§Errors
Returns an error if the macOS 15 environment APIs are unavailable or the Swift bridge rejects the request.
Sourcepub fn add_observer<O>(
&self,
observer: O,
) -> Result<LAEnvironmentObserverRegistration>where
O: LAEnvironmentObserver,
pub fn add_observer<O>(
&self,
observer: O,
) -> Result<LAEnvironmentObserverRegistration>where
O: LAEnvironmentObserver,
Register an observer for environment state changes.
Keep the returned registration alive for as long as the observer should remain registered. Dropping it releases the weakly-held observer object.
§Errors
Returns an error if the macOS 15 environment APIs are unavailable or the Swift bridge rejects the request.
Sourcepub fn remove_observer(
&self,
observer: &LAEnvironmentObserverRegistration,
) -> Result<()>
pub fn remove_observer( &self, observer: &LAEnvironmentObserverRegistration, ) -> Result<()>
Remove a previously registered observer.
§Errors
Returns an error if the macOS 15 environment APIs are unavailable or the Swift bridge rejects the request.