pub struct SessionName(/* private fields */);Expand description
A validated RMUX session name.
Empty strings are rejected. : and . characters are rewritten to _
to keep names safe for use inside exact target syntax (session,
session:window, session:window.pane). Non-printable characters are
rendered using tmux’s vis-style escape sequences so display output is
always single-line and non-controlling.
Implementations§
Source§impl SessionName
impl SessionName
Sourcepub fn new(value: impl Into<String>) -> Result<SessionName, RmuxError>
pub fn new(value: impl Into<String>) -> Result<SessionName, RmuxError>
Validates and stores a session name using tmux-compatible rewriting.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes the wrapper and returns the sanitized string.
Trait Implementations§
Source§impl AsRef<str> for SessionName
impl AsRef<str> for SessionName
Source§impl Clone for SessionName
impl Clone for SessionName
Source§fn clone(&self) -> SessionName
fn clone(&self) -> SessionName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionName
impl Debug for SessionName
Source§impl<'de> Deserialize<'de> for SessionName
impl<'de> Deserialize<'de> for SessionName
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SessionName, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SessionName, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SessionName
impl Display for SessionName
impl Eq for SessionName
Source§impl FromStr for SessionName
impl FromStr for SessionName
Source§impl Hash for SessionName
impl Hash for SessionName
Source§impl PartialEq for SessionName
impl PartialEq for SessionName
Source§fn eq(&self, other: &SessionName) -> bool
fn eq(&self, other: &SessionName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SessionName
impl Serialize for SessionName
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SessionName
Source§impl TryFrom<&str> for SessionName
impl TryFrom<&str> for SessionName
Auto Trait Implementations§
impl Freeze for SessionName
impl RefUnwindSafe for SessionName
impl Send for SessionName
impl Sync for SessionName
impl Unpin for SessionName
impl UnsafeUnpin for SessionName
impl UnwindSafe for SessionName
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