[][src]Struct zbus_polkit::policykit1::Subject

pub struct Subject {
    pub subject_kind: String,
    pub subject_details: HashMap<String, OwnedValue>,
}

This struct describes subjects such as UNIX processes. It is typically used to check if a given process is authorized for an action.

The following kinds of subjects are known:

  • Unix Process. subject_kind should be set to unix-process with keys pid (of type uint32) and start-time (of type uint64).

  • Unix Session. subject_kind should be set to unix-session with the key session-id (of type string).

  • System Bus Name. subject_kind should be set to system-bus-name with the key name (of type string).

Fields

subject_kind: String

The type of the subject.

subject_details: HashMap<String, OwnedValue>

Details about the subject. Depending of the value of subject_kind, a set of well-defined key/value pairs are guaranteed to be available.

Implementations

impl Subject[src]

pub fn new_for_owner(
    pid: u32,
    start_time: Option<u64>,
    uid: Option<u32>
) -> Result<Self, Error>
[src]

Create a Subject for pid, start_time & uid.

Arguments

  • pid - The process ID

  • start_time - The start time for pid or None to look it up in e.g. /proc

  • uid - The (real, not effective) uid of the owner of pid or None to look it up in e.g. /proc

Trait Implementations

impl Debug for Subject[src]

impl<'de> Deserialize<'de> for Subject[src]

impl Serialize for Subject[src]

impl Type for Subject[src]

Auto Trait Implementations

impl RefUnwindSafe for Subject

impl Send for Subject

impl Sync for Subject

impl Unpin for Subject

impl UnwindSafe for Subject

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.