pub struct Base64;
Implementations§
Source§impl Base64
impl Base64
Sourcepub fn encode(input: &[u8]) -> String
pub fn encode(input: &[u8]) -> String
Encodes the input bytes into a Base64 string.
use codeckit::Base64;
fn main() {
let test_str = "test";
let encoded = Base64::encode(test_str.as_bytes());
println!("{}", encoded);
let original = Base64::decode(&encoded);
let original = String::from_utf8(original).unwrap();
println!("{:?}", original);
}
Auto Trait Implementations§
impl Freeze for Base64
impl RefUnwindSafe for Base64
impl Send for Base64
impl Sync for Base64
impl Unpin for Base64
impl UnwindSafe for Base64
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