pub struct Target {
pub groups: Vec<String>,
pub pcs: Vec<String>,
pub all: bool,
}Fields§
§groups: Vec<String>§pcs: Vec<String>§all: boolImplementations§
Source§impl Target
impl Target
Sourcepub fn is_specified(&self) -> bool
pub fn is_specified(&self) -> bool
At least one of all / groups / pcs is set.
Sourcepub fn matches(&self, pc_id: &str, groups: &[String]) -> bool
pub fn matches(&self, pc_id: &str, groups: &[String]) -> bool
Whether a PC (its pc_id + group membership) falls in this target:
all, or the pc is listed, or it belongs to a listed group. Used
by the agent to scope client.visible_to (#816). An unspecified
target matches nobody (callers should treat “no target” as
“visible to all” before calling this).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Target
impl JsonSchema for Target
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more