Skip to main content

MsgraphClientStd

Struct MsgraphClientStd 

Source
pub struct MsgraphClientStd {
    pub stream: Box<dyn MsgraphStream>,
    pub auth: HttpAuthBearer,
    pub user_id: String,
}
Available on crate feature client only.
Expand description

Std blocking Microsoft Graph client: a stream, the bearer credential and the mailbox owner, with one method per operation.

Fields§

§stream: Box<dyn MsgraphStream>

The stream carrying the HTTPS connection to the Graph API.

§auth: HttpAuthBearer

The bearer credential added to every request.

§user_id: String

The mailbox owner: me, a user id or a principal name.

Implementations§

Source§

impl MsgraphClientStd

Source

pub fn new<S: Read + Write + Send + 'static>( stream: S, token: impl ToString, options: MsgraphClientStdConnectOptions, ) -> Self

Builds a client over a caller-managed stream.

Source

pub fn connect( token: impl ToString, options: MsgraphClientStdConnectOptions, ) -> Result<Self, MsgraphClientStdError>

Available on crate features native-tls or rustls-aws or rustls-ring only.

Builds a client by opening a TCP/TLS connection to the Graph API endpoint through pimalaya-stream.

Source

pub fn set_stream<S: Read + Write + Send + 'static>(&mut self, stream: S)

Replaces the underlying stream (e.g. after a connection reset).

Source

pub fn run<C, T>( &mut self, coroutine: C, ) -> Result<MsgraphSendOutput<T>, MsgraphClientStdError>

Runs the given coroutine to completion against the stream, fulfilling its read and write requests.

Source

pub fn me( &mut self, ) -> Result<MsgraphSendOutput<MsgraphUser>, MsgraphClientStdError>

Gets the profile of the mailbox owner.

Source

pub fn mail_folders_list( &mut self, params: &MsgraphMailFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphMailFoldersListResponse>, MsgraphClientStdError>

Lists the mail folders of the mailbox.

Source

pub fn mail_folder_get( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>

Gets a mail folder by id.

Source

pub fn mail_folder_create( &mut self, folder: &MsgraphMailFolder, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>

Creates a mail folder.

Source

pub fn mail_folder_update( &mut self, id: &str, folder: &MsgraphMailFolder, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>

Updates a mail folder by id.

Source

pub fn mail_folder_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Deletes a mail folder by id.

Source

pub fn mail_folder_copy( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>

Copies a mail folder into a destination folder.

Source

pub fn mail_folder_move( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>

Moves a mail folder into a destination folder.

Source

pub fn mail_child_folders_list( &mut self, id: &str, params: &MsgraphMailFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphMailFoldersListResponse>, MsgraphClientStdError>

Lists the child folders of a mail folder.

Source

pub fn contact_folders_list( &mut self, params: &MsgraphContactFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphContactFoldersListResponse>, MsgraphClientStdError>

Lists the contact folders of the mailbox.

Source

pub fn contact_folder_get( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>

Gets a contact folder by id.

Source

pub fn contact_folder_create( &mut self, folder: &MsgraphContactFolder, ) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>

Creates a contact folder.

Source

pub fn contact_folder_update( &mut self, id: &str, folder: &MsgraphContactFolder, ) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>

Updates a contact folder by id.

Source

pub fn contact_folder_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Deletes a contact folder by id.

Source

pub fn contact_child_folders_list( &mut self, id: &str, params: &MsgraphContactFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphContactFoldersListResponse>, MsgraphClientStdError>

Lists the child folders of a contact folder.

Source

pub fn contacts_list( &mut self, folder: Option<&str>, params: &MsgraphContactsListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphContactsListResponse>, MsgraphClientStdError>

Lists the contacts of the default Contacts folder, or of the given contact folder.

Source

pub fn contact_get( &mut self, id: &str, expand: Option<&str>, ) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>

Gets a contact by id, optionally expanding the given relations.

Source

pub fn contact_create( &mut self, folder: Option<&str>, contact: &MsgraphContact, ) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>

Creates a contact in the default Contacts folder, or in the given contact folder.

Source

pub fn contact_update( &mut self, id: &str, contact: &MsgraphContact, ) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>

Updates a contact by id.

Source

pub fn contact_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Deletes a contact by id.

Source

pub fn contacts_delta( &mut self, folder: Option<&str>, select: Option<&str>, ) -> Result<MsgraphSendOutput<MsgraphContactsDeltaResponse>, MsgraphClientStdError>

Starts a contacts delta round over the default Contacts folder, or over the given contact folder.

Source

pub fn messages_list( &mut self, folder: Option<&str>, params: &MsgraphMessagesListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphMessagesListResponse>, MsgraphClientStdError>

Lists the messages of the whole mailbox, or of the given mail folder.

Source

pub fn message_get( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>

Gets a message by id.

Source

pub fn message_get_raw( &mut self, id: &str, ) -> Result<MsgraphSendOutput<Vec<u8>>, MsgraphClientStdError>

Gets the raw RFC 5322 MIME content of a message by id.

Source

pub fn message_create( &mut self, folder: Option<&str>, message: &MsgraphMessage, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>

Creates a draft message from JSON in the Drafts folder, or in the given mail folder.

Source

pub fn message_create_mime( &mut self, folder: Option<&str>, raw: &[u8], ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>

Creates a draft message from raw RFC 5322 MIME bytes in the Drafts folder, or in the given mail folder.

Source

pub fn message_update( &mut self, id: &str, message: &MsgraphMessage, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>

Updates a message by id.

Source

pub fn message_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Deletes a message by id.

Source

pub fn message_move( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>

Moves a message into a destination folder.

Source

pub fn message_copy( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>

Copies a message into a destination folder.

Source

pub fn attachment_create( &mut self, message_id: &str, name: &str, content: &[u8], content_type: Option<&str>, ) -> Result<MsgraphSendOutput<MsgraphAttachment>, MsgraphClientStdError>

Creates a file attachment on a message.

Source

pub fn attachments_list( &mut self, message_id: &str, ) -> Result<MsgraphSendOutput<MsgraphAttachmentsListResponse>, MsgraphClientStdError>

Lists the attachments of a message.

Source

pub fn attachment_get_raw( &mut self, message_id: &str, attachment_id: &str, ) -> Result<MsgraphSendOutput<Vec<u8>>, MsgraphClientStdError>

Gets the raw content of an attachment.

Source

pub fn attachment_delete( &mut self, message_id: &str, attachment_id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Deletes an attachment of a message.

Source

pub fn message_send( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Sends an existing draft message by id.

Source

pub fn mail_send( &mut self, message: &MsgraphMessage, save_to_sent_items: bool, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Sends a message described as JSON through the sendMail action.

Source

pub fn mail_send_mime( &mut self, raw: &[u8], ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>

Sends a message given as raw RFC 5322 MIME bytes through the sendMail action.

Trait Implementations§

Source§

impl Debug for MsgraphClientStd

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.