pub struct Layout { /* private fields */ }Implementations§
Source§impl Layout
impl Layout
Sourcepub fn try_new(
form: Form,
target: Span,
peer: Option<Span>,
route: Option<Span>,
) -> Result<Self, Error>
pub fn try_new( form: Form, target: Span, peer: Option<Span>, route: Option<Span>, ) -> Result<Self, Error>
The single checked construction path for a retained layout: the target
span is packed for form and the companion spans are proved to sit
inside that target before they are stored.
Sourcepub const fn new(
target: Target,
peer: Option<Span>,
route: Option<Span>,
) -> Self
pub const fn new( target: Target, peer: Option<Span>, route: Option<Span>, ) -> Self
Stores pre-packed parts without re-checking the shape they must share.
Binding must prove the shape, ranges and bytes for the exact owner,
either with Self::is_valid or by preserving parser admission.
pub const fn target(self) -> Target
pub const fn route(self) -> Option<Span>
pub fn route_path(self, owner: &[u8]) -> Option<&[u8]>
pub const fn require(self) -> Result<Self, Error>
pub fn is_valid(self, owner: &[u8]) -> bool
Trait Implementations§
impl Copy for Layout
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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