pub struct ConstantSliceRecord<'a> { /* private fields */ }Expand description
A record that serves path and attributes from slices.
This is mostly used internally, but can be used through the public constructors in a
Reporting::report() method.
This enables relatively simple creation of reports directly at the resource type level
(although unfortunately, doing this is still way more verbose than adding a resource using
.at_with_attributes()).
Implementations§
Source§impl<'a> ConstantSliceRecord<'a>
impl<'a> ConstantSliceRecord<'a>
Sourcepub fn new(attributes: &'a [Attribute]) -> Self
pub fn new(attributes: &'a [Attribute]) -> Self
Constructs a record from attributes.
The path is empty, as is suitable for the large class of handlers that do not process any Uri-Path options on their own.
Sourcepub fn new_with_path(path: &'a [&'a str], attributes: &'a [Attribute]) -> Self
pub fn new_with_path(path: &'a [&'a str], attributes: &'a [Attribute]) -> Self
Constructs a record from path segments and attributes.
Trait Implementations§
Source§impl<'a> Record for ConstantSliceRecord<'a>
impl<'a> Record for ConstantSliceRecord<'a>
type PathElement = &'a &'a str
type PathElements = Iter<'a, &'a str>
type Attributes = Cloned<Iter<'a, Attribute>>
Source§fn path(&self) -> Self::PathElements
fn path(&self) -> Self::PathElements
List of path segments (equivalent to Uri-Path option values) leading to the indicated
resoruce
Source§fn rel(&self) -> Option<&str>
fn rel(&self) -> Option<&str>
Link relation (or None to default to the implicit “hosts”) Read more
Source§fn attributes(&self) -> Self::Attributes
fn attributes(&self) -> Self::Attributes
Target attributes of the link
Auto Trait Implementations§
impl<'a> Freeze for ConstantSliceRecord<'a>
impl<'a> RefUnwindSafe for ConstantSliceRecord<'a>
impl<'a> Send for ConstantSliceRecord<'a>
impl<'a> Sync for ConstantSliceRecord<'a>
impl<'a> Unpin for ConstantSliceRecord<'a>
impl<'a> UnwindSafe for ConstantSliceRecord<'a>
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