pub struct Destination { /* private fields */ }Expand description
A set of properties to describe where and how to try to connect.
This type is passed an argument for the Connect trait.
Implementations§
Source§impl Destination
impl Destination
Sourcepub fn try_from_uri(uri: Uri) -> Result<Destination, Error>
pub fn try_from_uri(uri: Uri) -> Result<Destination, Error>
Try to convert a Uri into a Destination
§Error
Returns an error if the uri contains no authority or no scheme.
Sourcepub fn set_port<P>(&mut self, port: P)
pub fn set_port<P>(&mut self, port: P)
Update the port of this destination.
§Example
// let mut dst = some_destination...
// Change from "None"...
assert_eq!(dst.port(), None);
// to "4321"...
dst.set_port(4321);
assert_eq!(dst.port(), Some(4321));
// Or remove the port...
dst.set_port(None);
assert_eq!(dst.port(), None);Trait Implementations§
Source§impl Clone for Destination
impl Clone for Destination
Source§fn clone(&self) -> Destination
fn clone(&self) -> Destination
Returns a duplicate of the value. Read more
1.0.0 · 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 Destination
impl Debug for Destination
Auto Trait Implementations§
impl !Freeze for Destination
impl RefUnwindSafe for Destination
impl Send for Destination
impl Sync for Destination
impl Unpin for Destination
impl UnwindSafe for Destination
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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