pub struct FieldMeta {
pub content: String,
pub visibility: Role,
}Expand description
Field-level visibility marker for hints, descriptions, and metadata.
Allows marking individual hints or descriptions with different visibility levels. For example, a hint might be marked as Internal-only while the error itself is Public.
§Examples
use waddling_errors::FieldMeta;
let public_hint = FieldMeta::public("Check the API documentation");
let internal_hint = FieldMeta::internal("Check Redis connection on host-01");Fields§
§content: StringThe actual text content
visibility: RoleVisibility level for this field
Implementations§
Source§impl FieldMeta
impl FieldMeta
Sourcepub fn developer(content: impl Into<String>) -> Self
pub fn developer(content: impl Into<String>) -> Self
Create a developer field (visible to developers)
Sourcepub fn internal(content: impl Into<String>) -> Self
pub fn internal(content: impl Into<String>) -> Self
Create an internal field (visible to internal team only)
Sourcepub fn visible_at(&self, role: Role) -> bool
pub fn visible_at(&self, role: Role) -> bool
Check if this field should be visible at the given role level
Trait Implementations§
impl Eq for FieldMeta
impl StructuralPartialEq for FieldMeta
Auto Trait Implementations§
impl Freeze for FieldMeta
impl RefUnwindSafe for FieldMeta
impl Send for FieldMeta
impl Sync for FieldMeta
impl Unpin for FieldMeta
impl UnwindSafe for FieldMeta
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