[][src]Trait dbus_strings::StringLike

pub trait StringLike: ToOwned {
    const NAME: &'static str;

    fn new_unchecked(_: &str) -> &Self;
fn new_unchecked_owned(_: String) -> Self::Owned;
fn is_valid(_: &str) -> Result<(), InvalidStringError>; fn new(s: &str) -> Result<&Self, InvalidStringError> { ... }
fn new_owned<S: Into<String>>(
        s: S
    ) -> Result<Self::Owned, InvalidStringError> { ... } }

A D-Bus string-like type - a basic (non-container) type with variable length.

It wraps a str, which means that it is unsized.

Associated Constants

const NAME: &'static str

The name of the type

Loading content...

Required methods

fn new_unchecked(_: &str) -> &Self

Creates a new borrowed string without actually checking that it is valid.

Sending this over D-Bus if actually invalid, could result in e g immediate disconnection from the server.

fn new_unchecked_owned(_: String) -> Self::Owned

Creates a new owned string without actually checking that it is valid.

Sending this over D-Bus if actually invalid, could result in e g immediate disconnection from the server.

fn is_valid(_: &str) -> Result<(), InvalidStringError>

Checks whether or not a string is valid.

Loading content...

Provided methods

fn new(s: &str) -> Result<&Self, InvalidStringError>

Creates a new borrowed string

fn new_owned<S: Into<String>>(s: S) -> Result<Self::Owned, InvalidStringError>

Creates a new owned string

Loading content...

Implementors

impl StringLike for BusName[src]

impl StringLike for DBusStr[src]

impl StringLike for ErrorName[src]

impl StringLike for InterfaceName[src]

impl StringLike for MemberName[src]

impl StringLike for ObjectPath[src]

impl StringLike for SignatureMulti[src]

impl StringLike for SignatureSingle[src]

Loading content...