Struct itsdangerous::Separator
source · [−]pub struct Separator(_);
Expand description
A separator character that can be used in crate::SignerBuilder::with_separator
.
This is used to join the various parts of the signed payload.
Basic Usage
use itsdangerous::{default_builder, Separator};
// Creates a separator using a given character.
let separator = Separator::new('!').expect("Invalid separator :(");
// Use that separator in the builder.
let signer = default_builder("hello")
.with_separator(separator)
.build();
Implementations
sourceimpl Separator
impl Separator
sourcepub fn new(separator: char) -> Result<Self, InvalidSeparator>
pub fn new(separator: char) -> Result<Self, InvalidSeparator>
Creates a new separator, checking to make sure it is valid.
A valid separator is a character that is not in the base-64 url-safe alphabet.
pub fn split<'a>(
&self,
value: &'a str
) -> Result<(&'a str, &'a str), SeparatorNotFound>
Trait Implementations
impl Copy for Separator
impl Eq for Separator
impl StructuralEq for Separator
impl StructuralPartialEq for Separator
Auto Trait Implementations
impl RefUnwindSafe for Separator
impl Send for Separator
impl Sync for Separator
impl Unpin for Separator
impl UnwindSafe for Separator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more