pub struct MsgraphClientStd {
pub stream: Box<dyn MsgraphStream>,
pub auth: HttpAuthBearer,
pub user_id: String,
}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: HttpAuthBearerThe bearer credential added to every request.
user_id: StringThe mailbox owner: me, a user id or a principal name.
Implementations§
Source§impl MsgraphClientStd
impl MsgraphClientStd
Sourcepub fn new<S: Read + Write + Send + 'static>(
stream: S,
token: impl ToString,
options: MsgraphClientStdConnectOptions,
) -> Self
pub fn new<S: Read + Write + Send + 'static>( stream: S, token: impl ToString, options: MsgraphClientStdConnectOptions, ) -> Self
Builds a client over a caller-managed stream.
Sourcepub fn connect(
token: impl ToString,
options: MsgraphClientStdConnectOptions,
) -> Result<Self, MsgraphClientStdError>
Available on crate features native-tls or rustls-aws or rustls-ring only.
pub fn connect( token: impl ToString, options: MsgraphClientStdConnectOptions, ) -> Result<Self, MsgraphClientStdError>
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.
Sourcepub fn set_stream<S: Read + Write + Send + 'static>(&mut self, stream: S)
pub fn set_stream<S: Read + Write + Send + 'static>(&mut self, stream: S)
Replaces the underlying stream (e.g. after a connection reset).
Sourcepub fn run<C, T>(
&mut self,
coroutine: C,
) -> Result<MsgraphSendOutput<T>, MsgraphClientStdError>where
C: MsgraphCoroutine<Yield = MsgraphYield, Return = Result<MsgraphSendOutput<T>, MsgraphSendError>>,
pub fn run<C, T>(
&mut self,
coroutine: C,
) -> Result<MsgraphSendOutput<T>, MsgraphClientStdError>where
C: MsgraphCoroutine<Yield = MsgraphYield, Return = Result<MsgraphSendOutput<T>, MsgraphSendError>>,
Runs the given coroutine to completion against the stream, fulfilling its read and write requests.
Sourcepub fn me(
&mut self,
) -> Result<MsgraphSendOutput<MsgraphUser>, MsgraphClientStdError>
pub fn me( &mut self, ) -> Result<MsgraphSendOutput<MsgraphUser>, MsgraphClientStdError>
Gets the profile of the mailbox owner.
Sourcepub fn mail_folders_list(
&mut self,
params: &MsgraphMailFoldersListParams<'_>,
) -> Result<MsgraphSendOutput<MsgraphMailFoldersListResponse>, MsgraphClientStdError>
pub fn mail_folders_list( &mut self, params: &MsgraphMailFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphMailFoldersListResponse>, MsgraphClientStdError>
Lists the mail folders of the mailbox.
Sourcepub fn mail_folder_get(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
pub fn mail_folder_get( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
Gets a mail folder by id.
Sourcepub fn mail_folder_create(
&mut self,
folder: &MsgraphMailFolder,
) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
pub fn mail_folder_create( &mut self, folder: &MsgraphMailFolder, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
Creates a mail folder.
Sourcepub fn mail_folder_update(
&mut self,
id: &str,
folder: &MsgraphMailFolder,
) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
pub fn mail_folder_update( &mut self, id: &str, folder: &MsgraphMailFolder, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
Updates a mail folder by id.
Sourcepub fn mail_folder_delete(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
pub fn mail_folder_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
Deletes a mail folder by id.
Sourcepub fn mail_folder_copy(
&mut self,
id: &str,
destination: &str,
) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
pub fn mail_folder_copy( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
Copies a mail folder into a destination folder.
Sourcepub fn mail_folder_move(
&mut self,
id: &str,
destination: &str,
) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
pub fn mail_folder_move( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMailFolder>, MsgraphClientStdError>
Moves a mail folder into a destination folder.
Sourcepub fn mail_child_folders_list(
&mut self,
id: &str,
params: &MsgraphMailFoldersListParams<'_>,
) -> Result<MsgraphSendOutput<MsgraphMailFoldersListResponse>, MsgraphClientStdError>
pub fn mail_child_folders_list( &mut self, id: &str, params: &MsgraphMailFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphMailFoldersListResponse>, MsgraphClientStdError>
Lists the child folders of a mail folder.
Sourcepub fn contact_folders_list(
&mut self,
params: &MsgraphContactFoldersListParams<'_>,
) -> Result<MsgraphSendOutput<MsgraphContactFoldersListResponse>, MsgraphClientStdError>
pub fn contact_folders_list( &mut self, params: &MsgraphContactFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphContactFoldersListResponse>, MsgraphClientStdError>
Lists the contact folders of the mailbox.
Sourcepub fn contact_folder_get(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>
pub fn contact_folder_get( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>
Gets a contact folder by id.
Sourcepub fn contact_folder_create(
&mut self,
folder: &MsgraphContactFolder,
) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>
pub fn contact_folder_create( &mut self, folder: &MsgraphContactFolder, ) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>
Creates a contact folder.
Sourcepub fn contact_folder_update(
&mut self,
id: &str,
folder: &MsgraphContactFolder,
) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>
pub fn contact_folder_update( &mut self, id: &str, folder: &MsgraphContactFolder, ) -> Result<MsgraphSendOutput<MsgraphContactFolder>, MsgraphClientStdError>
Updates a contact folder by id.
Sourcepub fn contact_folder_delete(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
pub fn contact_folder_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
Deletes a contact folder by id.
Sourcepub fn contact_child_folders_list(
&mut self,
id: &str,
params: &MsgraphContactFoldersListParams<'_>,
) -> Result<MsgraphSendOutput<MsgraphContactFoldersListResponse>, MsgraphClientStdError>
pub fn contact_child_folders_list( &mut self, id: &str, params: &MsgraphContactFoldersListParams<'_>, ) -> Result<MsgraphSendOutput<MsgraphContactFoldersListResponse>, MsgraphClientStdError>
Lists the child folders of a contact folder.
Sourcepub fn contacts_list(
&mut self,
folder: Option<&str>,
params: &MsgraphContactsListParams<'_>,
) -> Result<MsgraphSendOutput<MsgraphContactsListResponse>, MsgraphClientStdError>
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.
Sourcepub fn contact_get(
&mut self,
id: &str,
expand: Option<&str>,
) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>
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.
Sourcepub fn contact_create(
&mut self,
folder: Option<&str>,
contact: &MsgraphContact,
) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>
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.
Sourcepub fn contact_update(
&mut self,
id: &str,
contact: &MsgraphContact,
) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>
pub fn contact_update( &mut self, id: &str, contact: &MsgraphContact, ) -> Result<MsgraphSendOutput<MsgraphContact>, MsgraphClientStdError>
Updates a contact by id.
Sourcepub fn contact_delete(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
pub fn contact_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
Deletes a contact by id.
Sourcepub fn contacts_delta(
&mut self,
folder: Option<&str>,
select: Option<&str>,
) -> Result<MsgraphSendOutput<MsgraphContactsDeltaResponse>, MsgraphClientStdError>
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.
Sourcepub fn messages_list(
&mut self,
folder: Option<&str>,
params: &MsgraphMessagesListParams<'_>,
) -> Result<MsgraphSendOutput<MsgraphMessagesListResponse>, MsgraphClientStdError>
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.
Sourcepub fn message_get(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
pub fn message_get( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
Gets a message by id.
Sourcepub fn message_get_raw(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<Vec<u8>>, MsgraphClientStdError>
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.
Sourcepub fn message_create(
&mut self,
folder: Option<&str>,
message: &MsgraphMessage,
) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
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.
Sourcepub fn message_create_mime(
&mut self,
folder: Option<&str>,
raw: &[u8],
) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
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.
Sourcepub fn message_update(
&mut self,
id: &str,
message: &MsgraphMessage,
) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
pub fn message_update( &mut self, id: &str, message: &MsgraphMessage, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
Updates a message by id.
Sourcepub fn message_delete(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
pub fn message_delete( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
Deletes a message by id.
Sourcepub fn message_move(
&mut self,
id: &str,
destination: &str,
) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
pub fn message_move( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
Moves a message into a destination folder.
Sourcepub fn message_copy(
&mut self,
id: &str,
destination: &str,
) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
pub fn message_copy( &mut self, id: &str, destination: &str, ) -> Result<MsgraphSendOutput<MsgraphMessage>, MsgraphClientStdError>
Copies a message into a destination folder.
Sourcepub fn messages_delta(
&mut self,
folder: Option<&str>,
select: Option<&str>,
) -> Result<MsgraphSendOutput<MsgraphMessagesDeltaResponse>, MsgraphClientStdError>
pub fn messages_delta( &mut self, folder: Option<&str>, select: Option<&str>, ) -> Result<MsgraphSendOutput<MsgraphMessagesDeltaResponse>, MsgraphClientStdError>
Starts a messages delta round over the whole mailbox, or over the given mail folder.
Sourcepub fn messages_delta_from_link(
&mut self,
link: &str,
) -> Result<MsgraphSendOutput<MsgraphMessagesDeltaResponse>, MsgraphClientStdError>
pub fn messages_delta_from_link( &mut self, link: &str, ) -> Result<MsgraphSendOutput<MsgraphMessagesDeltaResponse>, MsgraphClientStdError>
Continues a messages delta round from an @odata.nextLink, or
starts the next round from a saved @odata.deltaLink.
Sourcepub fn attachment_create(
&mut self,
message_id: &str,
name: &str,
content: &[u8],
content_type: Option<&str>,
) -> Result<MsgraphSendOutput<MsgraphAttachment>, MsgraphClientStdError>
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.
Sourcepub fn attachments_list(
&mut self,
message_id: &str,
) -> Result<MsgraphSendOutput<MsgraphAttachmentsListResponse>, MsgraphClientStdError>
pub fn attachments_list( &mut self, message_id: &str, ) -> Result<MsgraphSendOutput<MsgraphAttachmentsListResponse>, MsgraphClientStdError>
Lists the attachments of a message.
Sourcepub fn attachment_get_raw(
&mut self,
message_id: &str,
attachment_id: &str,
) -> Result<MsgraphSendOutput<Vec<u8>>, MsgraphClientStdError>
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.
Sourcepub fn attachment_delete(
&mut self,
message_id: &str,
attachment_id: &str,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
pub fn attachment_delete( &mut self, message_id: &str, attachment_id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
Deletes an attachment of a message.
Sourcepub fn message_send(
&mut self,
id: &str,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
pub fn message_send( &mut self, id: &str, ) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
Sends an existing draft message by id.
Sourcepub fn mail_send(
&mut self,
message: &MsgraphMessage,
save_to_sent_items: bool,
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
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.
Sourcepub fn mail_send_mime(
&mut self,
raw: &[u8],
) -> Result<MsgraphSendOutput<MsgraphNoResponse>, MsgraphClientStdError>
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.