Request

Struct Request 

Source
pub struct Request<'x> {
    pub using: Vec<URI>,
    pub method_calls: Vec<(Method, Arguments, String)>,
    pub created_ids: Option<AHashMap<String, String>>,
    /* private fields */
}

Fields§

§using: Vec<URI>§method_calls: Vec<(Method, Arguments, String)>§created_ids: Option<AHashMap<String, String>>

Implementations§

Source§

impl Request<'_>

Source

pub fn copy_blob( &mut self, from_account_id: impl Into<String>, ) -> &mut CopyBlobRequest

Source

pub async fn send_copy_blob(self) -> Result<CopyBlobResponse>

Source§

impl<'x> Request<'x>

Source

pub fn new(client: &'x Client) -> Self

Source

pub fn account_id(self, account_id: impl Into<String>) -> Self

Source

pub async fn send(self) -> Result<Response<TaggedMethodResponse>>

Examples found in repository?
examples/result_reference.rs (line 39)
20async fn result_reference() {
21    // Connect to the JMAP server using Basic authentication
22    let client = Client::new()
23        .credentials(("john@example.org", "secret"))
24        .connect("https://jmap.example.org")
25        .await
26        .unwrap();
27
28    // Delete e-mails matching a filter
29    let mut request = client.build();
30    let result_ref = request
31        .query_email()
32        .filter(query::Filter::and([
33            email::query::Filter::has_keyword("$draft"),
34            email::query::Filter::from("bill"),
35        ]))
36        .result_reference();
37    request.set_email().destroy_ref(result_ref);
38    let _destroyed_ids = request
39        .send()
40        .await
41        .unwrap()
42        .unwrap_method_responses()
43        .pop()
44        .unwrap()
45        .unwrap_set_email()
46        .unwrap()
47        .take_destroyed_ids();
48
49    // Fetch mailboxes matching a filter
50    let mut request = client.build();
51    let query_result = request
52        .query_mailbox()
53        .filter(query::Filter::and([
54            mailbox::query::Filter::has_any_role(false),
55            mailbox::query::Filter::is_subscribed(true),
56        ]))
57        .result_reference();
58    request.get_mailbox().ids_ref(query_result).properties([
59        mailbox::Property::Id,
60        mailbox::Property::Name,
61        mailbox::Property::ParentId,
62        mailbox::Property::TotalEmails,
63        mailbox::Property::UnreadEmails,
64    ]);
65    let _mailboxes = request
66        .send()
67        .await
68        .unwrap()
69        .unwrap_method_responses()
70        .pop()
71        .unwrap()
72        .unwrap_get_mailbox()
73        .unwrap()
74        .take_list();
75
76    // Fetch only the updated properties of all mailboxes that changed
77    // since a state.
78    let mut request = client.build();
79    let changes_request = request.changes_mailbox("n").max_changes(0);
80    let properties_ref = changes_request.updated_properties_reference();
81    let updated_ref = changes_request.updated_reference();
82    request
83        .get_mailbox()
84        .ids_ref(updated_ref)
85        .properties_ref(properties_ref);
86    for mailbox in request
87        .send()
88        .await
89        .unwrap()
90        .unwrap_method_responses()
91        .pop()
92        .unwrap()
93        .unwrap_get_mailbox()
94        .unwrap()
95        .take_list()
96    {
97        println!("Changed mailbox: {:#?}", mailbox);
98    }
99}
Source

pub async fn send_ws(self) -> Result<String>

Examples found in repository?
examples/websocket.rs (line 52)
25async fn websocket() {
26    // Connect to the JMAP server using Basic authentication
27    let client = Client::new()
28        .credentials(("john@example.org", "secret"))
29        .connect("https://jmap.example.org")
30        .await
31        .unwrap();
32
33    // Connect to the WebSocket endpoint
34    let mut ws_stream = client.connect_ws().await.unwrap();
35
36    // Read WS messages on a separate thread
37    let (stream_tx, mut stream_rx) = mpsc::channel::<WebSocketMessage>(100);
38    tokio::spawn(async move {
39        while let Some(change) = ws_stream.next().await {
40            stream_tx.send(change.unwrap()).await.unwrap();
41        }
42    });
43
44    // Create a mailbox over WS
45    let mut request = client.build();
46    let create_id = request
47        .set_mailbox()
48        .create()
49        .name("WebSocket Test")
50        .create_id()
51        .unwrap();
52    let request_id = request.send_ws().await.unwrap();
53
54    // Read response from WS stream
55    let mailbox_id = if let Some(WebSocketMessage::Response(mut response)) = stream_rx.recv().await
56    {
57        assert_eq!(request_id, response.request_id().unwrap());
58        response
59            .pop_method_response()
60            .unwrap()
61            .unwrap_set_mailbox()
62            .unwrap()
63            .created(&create_id)
64            .unwrap()
65            .take_id()
66    } else {
67        unreachable!()
68    };
69
70    // Enable push notifications over WS
71    client
72        .enable_push_ws(None::<Vec<_>>, None::<&str>)
73        .await
74        .unwrap();
75
76    // Make changes over standard HTTP and expect a push notification via WS
77    client
78        .mailbox_update_sort_order(&mailbox_id, 1)
79        .await
80        .unwrap();
81    if let Some(WebSocketMessage::StateChange(changes)) = stream_rx.recv().await {
82        println!("Received changes: {:?}", changes);
83    } else {
84        unreachable!()
85    }
86}
Source

pub async fn send_single<T>(self) -> Result<T>

Source

pub fn params(&self, method: Method) -> RequestParams

Source

pub fn add_method_call( &mut self, method: Method, arguments: Arguments, ) -> &mut Arguments

Source

pub fn add_capability(&mut self, uri: URI)

Source

pub fn last_result_reference(&self, path: impl Into<String>) -> ResultReference

Source§

impl Request<'_>

Source

pub fn get_email(&mut self) -> &mut GetRequest<Email<Set>>

Source

pub async fn send_get_email(self) -> Result<EmailGetResponse>

Source

pub fn changes_email( &mut self, since_state: impl Into<String>, ) -> &mut ChangesRequest

Source

pub async fn send_changes_email(self) -> Result<ChangesResponse<Email<Get>>>

Source

pub fn query_email(&mut self) -> &mut QueryRequest<Email<Set>>

Examples found in repository?
examples/result_reference.rs (line 31)
20async fn result_reference() {
21    // Connect to the JMAP server using Basic authentication
22    let client = Client::new()
23        .credentials(("john@example.org", "secret"))
24        .connect("https://jmap.example.org")
25        .await
26        .unwrap();
27
28    // Delete e-mails matching a filter
29    let mut request = client.build();
30    let result_ref = request
31        .query_email()
32        .filter(query::Filter::and([
33            email::query::Filter::has_keyword("$draft"),
34            email::query::Filter::from("bill"),
35        ]))
36        .result_reference();
37    request.set_email().destroy_ref(result_ref);
38    let _destroyed_ids = request
39        .send()
40        .await
41        .unwrap()
42        .unwrap_method_responses()
43        .pop()
44        .unwrap()
45        .unwrap_set_email()
46        .unwrap()
47        .take_destroyed_ids();
48
49    // Fetch mailboxes matching a filter
50    let mut request = client.build();
51    let query_result = request
52        .query_mailbox()
53        .filter(query::Filter::and([
54            mailbox::query::Filter::has_any_role(false),
55            mailbox::query::Filter::is_subscribed(true),
56        ]))
57        .result_reference();
58    request.get_mailbox().ids_ref(query_result).properties([
59        mailbox::Property::Id,
60        mailbox::Property::Name,
61        mailbox::Property::ParentId,
62        mailbox::Property::TotalEmails,
63        mailbox::Property::UnreadEmails,
64    ]);
65    let _mailboxes = request
66        .send()
67        .await
68        .unwrap()
69        .unwrap_method_responses()
70        .pop()
71        .unwrap()
72        .unwrap_get_mailbox()
73        .unwrap()
74        .take_list();
75
76    // Fetch only the updated properties of all mailboxes that changed
77    // since a state.
78    let mut request = client.build();
79    let changes_request = request.changes_mailbox("n").max_changes(0);
80    let properties_ref = changes_request.updated_properties_reference();
81    let updated_ref = changes_request.updated_reference();
82    request
83        .get_mailbox()
84        .ids_ref(updated_ref)
85        .properties_ref(properties_ref);
86    for mailbox in request
87        .send()
88        .await
89        .unwrap()
90        .unwrap_method_responses()
91        .pop()
92        .unwrap()
93        .unwrap_get_mailbox()
94        .unwrap()
95        .take_list()
96    {
97        println!("Changed mailbox: {:#?}", mailbox);
98    }
99}
Source

pub async fn send_query_email(self) -> Result<QueryResponse>

Source

pub fn query_email_changes( &mut self, since_query_state: impl Into<String>, ) -> &mut QueryChangesRequest<Email<Set>>

Source

pub async fn send_query_email_changes(self) -> Result<QueryChangesResponse>

Source

pub fn set_email(&mut self) -> &mut SetRequest<Email<Set>>

Examples found in repository?
examples/result_reference.rs (line 37)
20async fn result_reference() {
21    // Connect to the JMAP server using Basic authentication
22    let client = Client::new()
23        .credentials(("john@example.org", "secret"))
24        .connect("https://jmap.example.org")
25        .await
26        .unwrap();
27
28    // Delete e-mails matching a filter
29    let mut request = client.build();
30    let result_ref = request
31        .query_email()
32        .filter(query::Filter::and([
33            email::query::Filter::has_keyword("$draft"),
34            email::query::Filter::from("bill"),
35        ]))
36        .result_reference();
37    request.set_email().destroy_ref(result_ref);
38    let _destroyed_ids = request
39        .send()
40        .await
41        .unwrap()
42        .unwrap_method_responses()
43        .pop()
44        .unwrap()
45        .unwrap_set_email()
46        .unwrap()
47        .take_destroyed_ids();
48
49    // Fetch mailboxes matching a filter
50    let mut request = client.build();
51    let query_result = request
52        .query_mailbox()
53        .filter(query::Filter::and([
54            mailbox::query::Filter::has_any_role(false),
55            mailbox::query::Filter::is_subscribed(true),
56        ]))
57        .result_reference();
58    request.get_mailbox().ids_ref(query_result).properties([
59        mailbox::Property::Id,
60        mailbox::Property::Name,
61        mailbox::Property::ParentId,
62        mailbox::Property::TotalEmails,
63        mailbox::Property::UnreadEmails,
64    ]);
65    let _mailboxes = request
66        .send()
67        .await
68        .unwrap()
69        .unwrap_method_responses()
70        .pop()
71        .unwrap()
72        .unwrap_get_mailbox()
73        .unwrap()
74        .take_list();
75
76    // Fetch only the updated properties of all mailboxes that changed
77    // since a state.
78    let mut request = client.build();
79    let changes_request = request.changes_mailbox("n").max_changes(0);
80    let properties_ref = changes_request.updated_properties_reference();
81    let updated_ref = changes_request.updated_reference();
82    request
83        .get_mailbox()
84        .ids_ref(updated_ref)
85        .properties_ref(properties_ref);
86    for mailbox in request
87        .send()
88        .await
89        .unwrap()
90        .unwrap_method_responses()
91        .pop()
92        .unwrap()
93        .unwrap_get_mailbox()
94        .unwrap()
95        .take_list()
96    {
97        println!("Changed mailbox: {:#?}", mailbox);
98    }
99}
Source

pub async fn send_set_email(self) -> Result<EmailSetResponse>

Source

pub fn copy_email( &mut self, from_account_id: impl Into<String>, ) -> &mut CopyRequest<Email<Set>>

Source

pub async fn send_copy_email(self) -> Result<EmailCopyResponse>

Source

pub fn import_email(&mut self) -> &mut EmailImportRequest

Source

pub async fn send_import_email(self) -> Result<EmailImportResponse>

Source

pub fn parse_email(&mut self) -> &mut EmailParseRequest

Source

pub async fn send_parse_email(self) -> Result<EmailParseResponse>

Source

pub fn get_search_snippet(&mut self) -> &mut SearchSnippetGetRequest

Source

pub async fn send_get_search_snippet(self) -> Result<SearchSnippetGetResponse>

Source§

impl Request<'_>

Source§

impl Request<'_>

Source

pub fn get_identity(&mut self) -> &mut GetRequest<Identity<Set>>

Source

pub async fn send_get_identity(self) -> Result<IdentityGetResponse>

Source

pub fn set_identity(&mut self) -> &mut SetRequest<Identity<Set>>

Source

pub async fn send_set_identity(self) -> Result<IdentitySetResponse>

Source

pub fn changes_identity( &mut self, since_state: impl Into<String>, ) -> &mut ChangesRequest

Source

pub async fn send_changes_identity( self, ) -> Result<ChangesResponse<Identity<Get>>>

Source§

impl Request<'_>

Source

pub fn get_mailbox(&mut self) -> &mut GetRequest<Mailbox<Set>>

Examples found in repository?
examples/result_reference.rs (line 58)
20async fn result_reference() {
21    // Connect to the JMAP server using Basic authentication
22    let client = Client::new()
23        .credentials(("john@example.org", "secret"))
24        .connect("https://jmap.example.org")
25        .await
26        .unwrap();
27
28    // Delete e-mails matching a filter
29    let mut request = client.build();
30    let result_ref = request
31        .query_email()
32        .filter(query::Filter::and([
33            email::query::Filter::has_keyword("$draft"),
34            email::query::Filter::from("bill"),
35        ]))
36        .result_reference();
37    request.set_email().destroy_ref(result_ref);
38    let _destroyed_ids = request
39        .send()
40        .await
41        .unwrap()
42        .unwrap_method_responses()
43        .pop()
44        .unwrap()
45        .unwrap_set_email()
46        .unwrap()
47        .take_destroyed_ids();
48
49    // Fetch mailboxes matching a filter
50    let mut request = client.build();
51    let query_result = request
52        .query_mailbox()
53        .filter(query::Filter::and([
54            mailbox::query::Filter::has_any_role(false),
55            mailbox::query::Filter::is_subscribed(true),
56        ]))
57        .result_reference();
58    request.get_mailbox().ids_ref(query_result).properties([
59        mailbox::Property::Id,
60        mailbox::Property::Name,
61        mailbox::Property::ParentId,
62        mailbox::Property::TotalEmails,
63        mailbox::Property::UnreadEmails,
64    ]);
65    let _mailboxes = request
66        .send()
67        .await
68        .unwrap()
69        .unwrap_method_responses()
70        .pop()
71        .unwrap()
72        .unwrap_get_mailbox()
73        .unwrap()
74        .take_list();
75
76    // Fetch only the updated properties of all mailboxes that changed
77    // since a state.
78    let mut request = client.build();
79    let changes_request = request.changes_mailbox("n").max_changes(0);
80    let properties_ref = changes_request.updated_properties_reference();
81    let updated_ref = changes_request.updated_reference();
82    request
83        .get_mailbox()
84        .ids_ref(updated_ref)
85        .properties_ref(properties_ref);
86    for mailbox in request
87        .send()
88        .await
89        .unwrap()
90        .unwrap_method_responses()
91        .pop()
92        .unwrap()
93        .unwrap_get_mailbox()
94        .unwrap()
95        .take_list()
96    {
97        println!("Changed mailbox: {:#?}", mailbox);
98    }
99}
Source

pub async fn send_get_mailbox(self) -> Result<MailboxGetResponse>

Source

pub fn changes_mailbox( &mut self, since_state: impl Into<String>, ) -> &mut ChangesRequest

Examples found in repository?
examples/result_reference.rs (line 79)
20async fn result_reference() {
21    // Connect to the JMAP server using Basic authentication
22    let client = Client::new()
23        .credentials(("john@example.org", "secret"))
24        .connect("https://jmap.example.org")
25        .await
26        .unwrap();
27
28    // Delete e-mails matching a filter
29    let mut request = client.build();
30    let result_ref = request
31        .query_email()
32        .filter(query::Filter::and([
33            email::query::Filter::has_keyword("$draft"),
34            email::query::Filter::from("bill"),
35        ]))
36        .result_reference();
37    request.set_email().destroy_ref(result_ref);
38    let _destroyed_ids = request
39        .send()
40        .await
41        .unwrap()
42        .unwrap_method_responses()
43        .pop()
44        .unwrap()
45        .unwrap_set_email()
46        .unwrap()
47        .take_destroyed_ids();
48
49    // Fetch mailboxes matching a filter
50    let mut request = client.build();
51    let query_result = request
52        .query_mailbox()
53        .filter(query::Filter::and([
54            mailbox::query::Filter::has_any_role(false),
55            mailbox::query::Filter::is_subscribed(true),
56        ]))
57        .result_reference();
58    request.get_mailbox().ids_ref(query_result).properties([
59        mailbox::Property::Id,
60        mailbox::Property::Name,
61        mailbox::Property::ParentId,
62        mailbox::Property::TotalEmails,
63        mailbox::Property::UnreadEmails,
64    ]);
65    let _mailboxes = request
66        .send()
67        .await
68        .unwrap()
69        .unwrap_method_responses()
70        .pop()
71        .unwrap()
72        .unwrap_get_mailbox()
73        .unwrap()
74        .take_list();
75
76    // Fetch only the updated properties of all mailboxes that changed
77    // since a state.
78    let mut request = client.build();
79    let changes_request = request.changes_mailbox("n").max_changes(0);
80    let properties_ref = changes_request.updated_properties_reference();
81    let updated_ref = changes_request.updated_reference();
82    request
83        .get_mailbox()
84        .ids_ref(updated_ref)
85        .properties_ref(properties_ref);
86    for mailbox in request
87        .send()
88        .await
89        .unwrap()
90        .unwrap_method_responses()
91        .pop()
92        .unwrap()
93        .unwrap_get_mailbox()
94        .unwrap()
95        .take_list()
96    {
97        println!("Changed mailbox: {:#?}", mailbox);
98    }
99}
Source

pub async fn send_changes_mailbox(self) -> Result<ChangesResponse<Mailbox<Get>>>

Source

pub fn query_mailbox(&mut self) -> &mut QueryRequest<Mailbox<Set>>

Examples found in repository?
examples/result_reference.rs (line 52)
20async fn result_reference() {
21    // Connect to the JMAP server using Basic authentication
22    let client = Client::new()
23        .credentials(("john@example.org", "secret"))
24        .connect("https://jmap.example.org")
25        .await
26        .unwrap();
27
28    // Delete e-mails matching a filter
29    let mut request = client.build();
30    let result_ref = request
31        .query_email()
32        .filter(query::Filter::and([
33            email::query::Filter::has_keyword("$draft"),
34            email::query::Filter::from("bill"),
35        ]))
36        .result_reference();
37    request.set_email().destroy_ref(result_ref);
38    let _destroyed_ids = request
39        .send()
40        .await
41        .unwrap()
42        .unwrap_method_responses()
43        .pop()
44        .unwrap()
45        .unwrap_set_email()
46        .unwrap()
47        .take_destroyed_ids();
48
49    // Fetch mailboxes matching a filter
50    let mut request = client.build();
51    let query_result = request
52        .query_mailbox()
53        .filter(query::Filter::and([
54            mailbox::query::Filter::has_any_role(false),
55            mailbox::query::Filter::is_subscribed(true),
56        ]))
57        .result_reference();
58    request.get_mailbox().ids_ref(query_result).properties([
59        mailbox::Property::Id,
60        mailbox::Property::Name,
61        mailbox::Property::ParentId,
62        mailbox::Property::TotalEmails,
63        mailbox::Property::UnreadEmails,
64    ]);
65    let _mailboxes = request
66        .send()
67        .await
68        .unwrap()
69        .unwrap_method_responses()
70        .pop()
71        .unwrap()
72        .unwrap_get_mailbox()
73        .unwrap()
74        .take_list();
75
76    // Fetch only the updated properties of all mailboxes that changed
77    // since a state.
78    let mut request = client.build();
79    let changes_request = request.changes_mailbox("n").max_changes(0);
80    let properties_ref = changes_request.updated_properties_reference();
81    let updated_ref = changes_request.updated_reference();
82    request
83        .get_mailbox()
84        .ids_ref(updated_ref)
85        .properties_ref(properties_ref);
86    for mailbox in request
87        .send()
88        .await
89        .unwrap()
90        .unwrap_method_responses()
91        .pop()
92        .unwrap()
93        .unwrap_get_mailbox()
94        .unwrap()
95        .take_list()
96    {
97        println!("Changed mailbox: {:#?}", mailbox);
98    }
99}
Source

pub async fn send_query_mailbox(self) -> Result<QueryResponse>

Source

pub fn query_mailbox_changes( &mut self, since_query_state: impl Into<String>, ) -> &mut QueryChangesRequest<Mailbox<Set>>

Source

pub async fn send_query_mailbox_changes(self) -> Result<QueryChangesResponse>

Source

pub fn set_mailbox(&mut self) -> &mut SetRequest<Mailbox<Set>>

Examples found in repository?
examples/websocket.rs (line 47)
25async fn websocket() {
26    // Connect to the JMAP server using Basic authentication
27    let client = Client::new()
28        .credentials(("john@example.org", "secret"))
29        .connect("https://jmap.example.org")
30        .await
31        .unwrap();
32
33    // Connect to the WebSocket endpoint
34    let mut ws_stream = client.connect_ws().await.unwrap();
35
36    // Read WS messages on a separate thread
37    let (stream_tx, mut stream_rx) = mpsc::channel::<WebSocketMessage>(100);
38    tokio::spawn(async move {
39        while let Some(change) = ws_stream.next().await {
40            stream_tx.send(change.unwrap()).await.unwrap();
41        }
42    });
43
44    // Create a mailbox over WS
45    let mut request = client.build();
46    let create_id = request
47        .set_mailbox()
48        .create()
49        .name("WebSocket Test")
50        .create_id()
51        .unwrap();
52    let request_id = request.send_ws().await.unwrap();
53
54    // Read response from WS stream
55    let mailbox_id = if let Some(WebSocketMessage::Response(mut response)) = stream_rx.recv().await
56    {
57        assert_eq!(request_id, response.request_id().unwrap());
58        response
59            .pop_method_response()
60            .unwrap()
61            .unwrap_set_mailbox()
62            .unwrap()
63            .created(&create_id)
64            .unwrap()
65            .take_id()
66    } else {
67        unreachable!()
68    };
69
70    // Enable push notifications over WS
71    client
72        .enable_push_ws(None::<Vec<_>>, None::<&str>)
73        .await
74        .unwrap();
75
76    // Make changes over standard HTTP and expect a push notification via WS
77    client
78        .mailbox_update_sort_order(&mailbox_id, 1)
79        .await
80        .unwrap();
81    if let Some(WebSocketMessage::StateChange(changes)) = stream_rx.recv().await {
82        println!("Received changes: {:?}", changes);
83    } else {
84        unreachable!()
85    }
86}
Source

pub async fn send_set_mailbox(self) -> Result<MailboxSetResponse>

Source§

impl Request<'_>

Source§

impl Request<'_>

Source§

impl Request<'_>

Source§

impl Request<'_>

Source

pub fn get_thread(&mut self) -> &mut GetRequest<Thread>

Source

pub async fn send_get_thread(self) -> Result<ThreadGetResponse>

Source

pub fn changes_thread( &mut self, since_state: impl Into<String>, ) -> &mut ChangesRequest

Source

pub async fn send_changes_thread(self) -> Result<ChangesResponse<Thread>>

Source§

impl Request<'_>

Trait Implementations§

Source§

impl<'x> Serialize for Request<'x>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'x> Freeze for Request<'x>

§

impl<'x> !RefUnwindSafe for Request<'x>

§

impl<'x> Send for Request<'x>

§

impl<'x> Sync for Request<'x>

§

impl<'x> Unpin for Request<'x>

§

impl<'x> !UnwindSafe for Request<'x>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,