#[non_exhaustive]pub struct VisibilityRule {
pub selector: String,
pub restriction: String,
/* private fields */
}
Expand description
A visibility rule provides visibility configuration for an individual API element.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.selector: String
Selects methods, messages, fields, enums, etc. to which this rule applies.
Refer to selector for syntax details.
restriction: String
A comma-separated list of visibility labels that apply to the selector
.
Any of the listed labels can be used to grant the visibility.
If a rule has multiple labels, removing one of the labels but not all of them can break clients.
Example:
visibility:
rules:
- selector: google.calendar.Calendar.EnhancedSearch
restriction: INTERNAL, PREVIEW
Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.
Implementations§
Source§impl VisibilityRule
impl VisibilityRule
pub fn new() -> Self
Sourcepub fn set_selector<T: Into<String>>(self, v: T) -> Self
pub fn set_selector<T: Into<String>>(self, v: T) -> Self
Sets the value of selector.
Sourcepub fn set_restriction<T: Into<String>>(self, v: T) -> Self
pub fn set_restriction<T: Into<String>>(self, v: T) -> Self
Sets the value of restriction.
Trait Implementations§
Source§impl Clone for VisibilityRule
impl Clone for VisibilityRule
Source§fn clone(&self) -> VisibilityRule
fn clone(&self) -> VisibilityRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VisibilityRule
impl Debug for VisibilityRule
Source§impl Default for VisibilityRule
impl Default for VisibilityRule
Source§fn default() -> VisibilityRule
fn default() -> VisibilityRule
Returns the “default value” for a type. Read more
Source§impl Message for VisibilityRule
impl Message for VisibilityRule
Source§impl PartialEq for VisibilityRule
impl PartialEq for VisibilityRule
impl StructuralPartialEq for VisibilityRule
Auto Trait Implementations§
impl Freeze for VisibilityRule
impl RefUnwindSafe for VisibilityRule
impl Send for VisibilityRule
impl Sync for VisibilityRule
impl Unpin for VisibilityRule
impl UnwindSafe for VisibilityRule
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