pub struct StringSessionBackend { /* private fields */ }Expand description
Portable base64 string session backend — Pyrogram/Telethon style.
The session is stored as a single URL-safe base64 string with no padding. Useful for deployment pipelines, Docker, environment variables, and CI bots.
§Example
let session_str = std::env::var("SESSION").unwrap();
let backend = StringSessionBackend::new(&session_str);
// ... pass to Config::session_backend
// Later, export the updated session:
let updated = backend.current();
println!("SESSION={updated}");Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StringSessionBackend
impl RefUnwindSafe for StringSessionBackend
impl Send for StringSessionBackend
impl Sync for StringSessionBackend
impl Unpin for StringSessionBackend
impl UnsafeUnpin for StringSessionBackend
impl UnwindSafe for StringSessionBackend
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more