pub struct SignatureWrapper<S: AsRef<str>>(_);
Expand description

Wraps a String or a &str or whatever implements AsRef and checks at creation, that it is a valid Signature

Implementations§

source§

impl<S: AsRef<str>> SignatureWrapper<S>

source

pub fn new(sig: S) -> Result<Self, Error>

Trait Implementations§

source§

impl<S: AsRef<str>> AsRef<str> for SignatureWrapper<S>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Debug + AsRef<str>> Debug for SignatureWrapper<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<S: AsRef<str>> Marshal for SignatureWrapper<S>

source§

fn marshal(&self, ctx: &mut MarshalContext<'_, '_>) -> Result<(), MarshalError>

source§

fn marshal_as_variant( &self, ctx: &mut MarshalContext<'_, '_> ) -> Result<(), MarshalError>

source§

impl<S: PartialEq + AsRef<str>> PartialEq<SignatureWrapper<S>> for SignatureWrapper<S>

source§

fn eq(&self, other: &SignatureWrapper<S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: AsRef<str>> Signature for SignatureWrapper<S>

source§

fn signature() -> Type

source§

fn alignment() -> usize

source§

fn sig_str(s_buf: &mut SignatureBuffer)

Appends the signature of the type to the SignatureBuffer. Read more
source§

fn has_sig(sig: &str) -> bool

Check if this type fulfills this signature. This may expect to only be called with valid signatures. But it might be called with the wrong signature. This means for example you must check the length before indexing. Read more
source§

unsafe fn valid_slice(_bo: ByteOrder) -> bool

If this returns true, it indicates that for implementing type T, Rust’s [T] is identical to DBus’s array format and can be copied into a message after aligning the first element. Read more
source§

impl<'a> TryFrom<&'a str> for SignatureWrapper<&'a str>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<String> for SignatureWrapper<String>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: String) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'buf, 'fds, S: AsRef<str> + From<&'buf str> + Unmarshal<'buf, 'fds>> Unmarshal<'buf, 'fds> for SignatureWrapper<S>

source§

fn unmarshal(ctx: &mut UnmarshalContext<'fds, 'buf>) -> UnmarshalResult<Self>

source§

impl<S: Eq + AsRef<str>> Eq for SignatureWrapper<S>

source§

impl<S: AsRef<str>> StructuralEq for SignatureWrapper<S>

source§

impl<S: AsRef<str>> StructuralPartialEq for SignatureWrapper<S>

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for SignatureWrapper<S>where S: RefUnwindSafe,

§

impl<S> Send for SignatureWrapper<S>where S: Send,

§

impl<S> Sync for SignatureWrapper<S>where S: Sync,

§

impl<S> Unpin for SignatureWrapper<S>where S: Unpin,

§

impl<S> UnwindSafe for SignatureWrapper<S>where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.