pub struct SnapshotEncoder<'output, E> { /* private fields */ }Expand description
Fixed-buffer snapshot encoder used by provider request components.
Instances are created only by encode_snapshot and
encode_snapshot_bounded. The first pass measures with checked
arithmetic; the second pass receives an exactly sized destination.
Implementations§
Source§impl<'output, E: Copy> SnapshotEncoder<'output, E>
impl<'output, E: Copy> SnapshotEncoder<'output, E>
Sourcepub fn percent_encoded(&mut self, value: &str) -> Result<(), E>
pub fn percent_encoded(&mut self, value: &str) -> Result<(), E>
Appends one RFC 3986 percent-encoded component.
Sourcepub fn json_string_escaped(&mut self, value: &str) -> Result<(), E>
pub fn json_string_escaped(&mut self, value: &str) -> Result<(), E>
Appends JSON string contents without surrounding quotes.
Sourcepub fn json_string(&mut self, value: &str) -> Result<(), E>
pub fn json_string(&mut self, value: &str) -> Result<(), E>
Appends a complete JSON string.
Sourcepub fn query_pair(
&mut self,
first: &mut bool,
key: &str,
value: &str,
) -> Result<(), E>
pub fn query_pair( &mut self, first: &mut bool, key: &str, value: &str, ) -> Result<(), E>
Appends a percent-encoded query pair.
Sourcepub fn query_u64(
&mut self,
first: &mut bool,
key: &str,
value: u64,
) -> Result<(), E>
pub fn query_u64( &mut self, first: &mut bool, key: &str, value: u64, ) -> Result<(), E>
Appends a percent-encoded query key and base-10 integer.
Sourcepub fn query_separator(&mut self, first: &mut bool) -> Result<(), E>
pub fn query_separator(&mut self, first: &mut bool) -> Result<(), E>
Appends & unless this is the first query pair.
Auto Trait Implementations§
impl<'output, E> !UnwindSafe for SnapshotEncoder<'output, E>
impl<'output, E> Freeze for SnapshotEncoder<'output, E>where
E: Freeze,
impl<'output, E> RefUnwindSafe for SnapshotEncoder<'output, E>where
E: RefUnwindSafe,
impl<'output, E> Send for SnapshotEncoder<'output, E>where
E: Send,
impl<'output, E> Sync for SnapshotEncoder<'output, E>where
E: Sync,
impl<'output, E> Unpin for SnapshotEncoder<'output, E>where
E: Unpin,
impl<'output, E> UnsafeUnpin for SnapshotEncoder<'output, E>where
E: UnsafeUnpin,
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