Struct imap_codec::response::Greeting
source · pub struct Greeting<'a> {
pub kind: GreetingKind,
pub code: Option<Code<'a>>,
pub text: Text<'a>,
}
Expand description
An IMAP greeting.
Note: Don’t use code: None
and a text
that starts with “[” as this would be ambiguous in IMAP.
Fields§
§kind: GreetingKind
§code: Option<Code<'a>>
§text: Text<'a>
Implementations§
source§impl<'a> Greeting<'a>
impl<'a> Greeting<'a>
pub fn new( kind: GreetingKind, code: Option<Code<'a>>, text: &'a str ) -> Result<Greeting<'a>, TextError>
pub fn ok( code: Option<Code<'a>>, text: &'a str ) -> Result<Greeting<'a>, TextError>
pub fn preauth( code: Option<Code<'a>>, text: &'a str ) -> Result<Greeting<'a>, TextError>
pub fn bye( code: Option<Code<'a>>, text: &'a str ) -> Result<Greeting<'a>, TextError>
Trait Implementations§
source§impl<'a> Arbitrary<'a> for Greeting<'a>
impl<'a> Arbitrary<'a> for Greeting<'a>
source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Greeting<'a>, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Greeting<'a>, Error>
Generate an arbitrary value of
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moresource§impl<'a> DecodeStatic for Greeting<'static>
impl<'a> DecodeStatic for Greeting<'static>
source§impl<'de, 'a> Deserialize<'de> for Greeting<'a>
impl<'de, 'a> Deserialize<'de> for Greeting<'a>
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Greeting<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Greeting<'a>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encoder<&Greeting<'_>> for ImapServerCodec
Available on crate feature tokio
only.
impl Encoder<&Greeting<'_>> for ImapServerCodec
Available on crate feature
tokio
only.source§impl<'a> IntoBoundedStatic for Greeting<'a>
impl<'a> IntoBoundedStatic for Greeting<'a>
source§fn into_static(self) -> <Greeting<'a> as IntoBoundedStatic>::Static
fn into_static(self) -> <Greeting<'a> as IntoBoundedStatic>::Static
Convert an owned
T
into an owned T
such that T: 'static
.source§impl<'a> PartialEq<Greeting<'a>> for Greeting<'a>
impl<'a> PartialEq<Greeting<'a>> for Greeting<'a>
source§impl<'a> Serialize for Greeting<'a>
impl<'a> Serialize for Greeting<'a>
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
source§impl<'a> ToBoundedStatic for Greeting<'a>
impl<'a> ToBoundedStatic for Greeting<'a>
impl<'a> Eq for Greeting<'a>
impl<'a> StructuralEq for Greeting<'a>
impl<'a> StructuralPartialEq for Greeting<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Greeting<'a>
impl<'a> Send for Greeting<'a>
impl<'a> Sync for Greeting<'a>
impl<'a> Unpin for Greeting<'a>
impl<'a> UnwindSafe for Greeting<'a>
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