Struct DocumentBuilder

Source
pub struct DocumentBuilder { /* private fields */ }

Implementations§

Source§

impl DocumentBuilder

Source

pub fn jsonapi<J: Into<JsonApiBuilder>>(self, jsonapi: J) -> Self

Examples found in repository?
examples/builders.rs (line 6)
4fn main() {
5    let document = jsonapis::DocumentBuilder::default()
6        .jsonapi(jsonapis::Version::new(0))
7        .meta1("current_page", 1)
8        .meta1("items_per_page", 2)
9        .meta1("total_pages", 3)
10        .meta1("total_items", 6)
11        .link("self", "http://example.com/posts.json?page=1")
12        .link("first", "http://example.com/posts.json?page=1")
13        .link("last", "http://example.com/posts.json?page=3")
14        .link("next", "http://example.com/posts.json?page=2")
15        .data(vec![
16            jsonapis::ResourceBuilder::new_with_id("posts", "1")
17                .link("self", "http://example.com/posts/1.json")
18                .attr("title", "Some blog post")
19                .attr("summary", "Here is the beginning of some blog post.")
20                .rel(
21                    "author",
22                    jsonapis::ResourceBuilder::new_with_id("users", "1")
23                        .link("self", "http://example.com/users/1.json")
24                        .attr("username", "alice"),
25                ),
26            jsonapis::ResourceBuilder::new_with_id("posts", "2")
27                .link("self", "http://example.com/posts/2.json")
28                .attr("title", "Other blog post")
29                .attr("summary", "Here is the beginning of other blog post.")
30                .rel(
31                    "author",
32                    jsonapis::ResourceBuilder::new_with_id("users", "2")
33                        .link("self", "http://example.com/users/2.json")
34                        .attr("username", "bob"),
35                ),
36        ])
37        .unwrap();
38
39    let expected_value = json!({
40        "jsonapi": json!({
41            "version": json!("1.0"),
42            "meta": json!(null),
43        }),
44        "meta": json!({
45            "current_page": json!(1),
46            "items_per_page": json!(2),
47            "total_pages": json!(3),
48            "total_items": json!(6),
49        }),
50        "links": json!({
51            "self": json!("http://example.com/posts.json?page=1"),
52            "related": json!(null),
53            "first": json!("http://example.com/posts.json?page=1"),
54            "last": json!("http://example.com/posts.json?page=3"),
55            "prev": json!(null),
56            "next": json!("http://example.com/posts.json?page=2"),
57            "about": json!(null),
58        }),
59        "data": json!([
60            json!({
61                "type": json!("posts"),
62                "id": json!("1"),
63                "meta": json!(null),
64                "links": json!({
65                    "self": json!("http://example.com/posts/1.json"),
66                    "related": json!(null),
67                    "first": json!(null),
68                    "last": json!(null),
69                    "prev": json!(null),
70                    "next": json!(null),
71                    "about": json!(null),
72                }),
73                "attributes": json!({
74                    "title": json!("Some blog post"),
75                    "summary": json!("Here is the beginning of some blog post."),
76                }),
77                "relationships": json!({
78                    "author": json!({
79                        "meta": json!(null),
80                        "links": json!(null),
81                        "data": json!({
82                            "type": json!("users"),
83                            "id": json!("1"),
84                            "meta": json!(null),
85                            "links": json!({
86                                "self": json!("http://example.com/users/1.json"),
87                                "related": json!(null),
88                                "first": json!(null),
89                                "last": json!(null),
90                                "prev": json!(null),
91                                "next": json!(null),
92                                "about": json!(null),
93                            }),
94                            "attributes": json!({
95                                "username": json!("alice"),
96                            }),
97                            "relationships": json!(null),
98                        }),
99                    }),
100                }),
101            }),
102            json!({
103                "type": json!("posts"),
104                "id": json!("2"),
105                "meta": json!(null),
106                "links": json!({
107                    "self": json!("http://example.com/posts/2.json"),
108                    "related": json!(null),
109                    "first": json!(null),
110                    "last": json!(null),
111                    "prev": json!(null),
112                    "next": json!(null),
113                    "about": json!(null),
114                }),
115                "attributes": json!({
116                    "title": json!("Other blog post"),
117                    "summary": json!("Here is the beginning of other blog post."),
118                }),
119                "relationships": json!({
120                    "author": json!({
121                        "meta": json!(null),
122                        "links": json!(null),
123                        "data": json!({
124                            "type": json!("users"),
125                            "id": json!("2"),
126                            "meta": json!(null),
127                            "links": json!({
128                                "self": json!("http://example.com/users/2.json"),
129                                "related": json!(null),
130                                "first": json!(null),
131                                "last": json!(null),
132                                "prev": json!(null),
133                                "next": json!(null),
134                                "about": json!(null),
135                            }),
136                            "attributes": json!({
137                                "username": json!("bob"),
138                            }),
139                            "relationships": json!(null),
140                        }),
141                    }),
142                }),
143            }),
144        ]),
145        "errors": json!(null),
146    });
147
148    let actual_json = serde_json::to_string(&document).unwrap();
149
150    let actual_value: Value = serde_json::from_str(&actual_json).unwrap();
151
152    println!("{:#?}", actual_value);
153
154    assert_eq!(actual_value, expected_value);
155}
Source

pub fn meta<M: Into<MetaOrAttrsBuilder>>(self, meta: M) -> Self

Source

pub fn data<D: Into<DataBuilder>>(self, data: D) -> Self

Examples found in repository?
examples/builders.rs (lines 15-36)
4fn main() {
5    let document = jsonapis::DocumentBuilder::default()
6        .jsonapi(jsonapis::Version::new(0))
7        .meta1("current_page", 1)
8        .meta1("items_per_page", 2)
9        .meta1("total_pages", 3)
10        .meta1("total_items", 6)
11        .link("self", "http://example.com/posts.json?page=1")
12        .link("first", "http://example.com/posts.json?page=1")
13        .link("last", "http://example.com/posts.json?page=3")
14        .link("next", "http://example.com/posts.json?page=2")
15        .data(vec![
16            jsonapis::ResourceBuilder::new_with_id("posts", "1")
17                .link("self", "http://example.com/posts/1.json")
18                .attr("title", "Some blog post")
19                .attr("summary", "Here is the beginning of some blog post.")
20                .rel(
21                    "author",
22                    jsonapis::ResourceBuilder::new_with_id("users", "1")
23                        .link("self", "http://example.com/users/1.json")
24                        .attr("username", "alice"),
25                ),
26            jsonapis::ResourceBuilder::new_with_id("posts", "2")
27                .link("self", "http://example.com/posts/2.json")
28                .attr("title", "Other blog post")
29                .attr("summary", "Here is the beginning of other blog post.")
30                .rel(
31                    "author",
32                    jsonapis::ResourceBuilder::new_with_id("users", "2")
33                        .link("self", "http://example.com/users/2.json")
34                        .attr("username", "bob"),
35                ),
36        ])
37        .unwrap();
38
39    let expected_value = json!({
40        "jsonapi": json!({
41            "version": json!("1.0"),
42            "meta": json!(null),
43        }),
44        "meta": json!({
45            "current_page": json!(1),
46            "items_per_page": json!(2),
47            "total_pages": json!(3),
48            "total_items": json!(6),
49        }),
50        "links": json!({
51            "self": json!("http://example.com/posts.json?page=1"),
52            "related": json!(null),
53            "first": json!("http://example.com/posts.json?page=1"),
54            "last": json!("http://example.com/posts.json?page=3"),
55            "prev": json!(null),
56            "next": json!("http://example.com/posts.json?page=2"),
57            "about": json!(null),
58        }),
59        "data": json!([
60            json!({
61                "type": json!("posts"),
62                "id": json!("1"),
63                "meta": json!(null),
64                "links": json!({
65                    "self": json!("http://example.com/posts/1.json"),
66                    "related": json!(null),
67                    "first": json!(null),
68                    "last": json!(null),
69                    "prev": json!(null),
70                    "next": json!(null),
71                    "about": json!(null),
72                }),
73                "attributes": json!({
74                    "title": json!("Some blog post"),
75                    "summary": json!("Here is the beginning of some blog post."),
76                }),
77                "relationships": json!({
78                    "author": json!({
79                        "meta": json!(null),
80                        "links": json!(null),
81                        "data": json!({
82                            "type": json!("users"),
83                            "id": json!("1"),
84                            "meta": json!(null),
85                            "links": json!({
86                                "self": json!("http://example.com/users/1.json"),
87                                "related": json!(null),
88                                "first": json!(null),
89                                "last": json!(null),
90                                "prev": json!(null),
91                                "next": json!(null),
92                                "about": json!(null),
93                            }),
94                            "attributes": json!({
95                                "username": json!("alice"),
96                            }),
97                            "relationships": json!(null),
98                        }),
99                    }),
100                }),
101            }),
102            json!({
103                "type": json!("posts"),
104                "id": json!("2"),
105                "meta": json!(null),
106                "links": json!({
107                    "self": json!("http://example.com/posts/2.json"),
108                    "related": json!(null),
109                    "first": json!(null),
110                    "last": json!(null),
111                    "prev": json!(null),
112                    "next": json!(null),
113                    "about": json!(null),
114                }),
115                "attributes": json!({
116                    "title": json!("Other blog post"),
117                    "summary": json!("Here is the beginning of other blog post."),
118                }),
119                "relationships": json!({
120                    "author": json!({
121                        "meta": json!(null),
122                        "links": json!(null),
123                        "data": json!({
124                            "type": json!("users"),
125                            "id": json!("2"),
126                            "meta": json!(null),
127                            "links": json!({
128                                "self": json!("http://example.com/users/2.json"),
129                                "related": json!(null),
130                                "first": json!(null),
131                                "last": json!(null),
132                                "prev": json!(null),
133                                "next": json!(null),
134                                "about": json!(null),
135                            }),
136                            "attributes": json!({
137                                "username": json!("bob"),
138                            }),
139                            "relationships": json!(null),
140                        }),
141                    }),
142                }),
143            }),
144        ]),
145        "errors": json!(null),
146    });
147
148    let actual_json = serde_json::to_string(&document).unwrap();
149
150    let actual_value: Value = serde_json::from_str(&actual_json).unwrap();
151
152    println!("{:#?}", actual_value);
153
154    assert_eq!(actual_value, expected_value);
155}
Source

pub fn errors<E: Into<ErrorObjectBuilder>>(self, errors: Vec<E>) -> Self

Source

pub fn meta1<N: ToString, V: Into<Value>>(self, name: N, meta1: V) -> Self

Examples found in repository?
examples/builders.rs (line 7)
4fn main() {
5    let document = jsonapis::DocumentBuilder::default()
6        .jsonapi(jsonapis::Version::new(0))
7        .meta1("current_page", 1)
8        .meta1("items_per_page", 2)
9        .meta1("total_pages", 3)
10        .meta1("total_items", 6)
11        .link("self", "http://example.com/posts.json?page=1")
12        .link("first", "http://example.com/posts.json?page=1")
13        .link("last", "http://example.com/posts.json?page=3")
14        .link("next", "http://example.com/posts.json?page=2")
15        .data(vec![
16            jsonapis::ResourceBuilder::new_with_id("posts", "1")
17                .link("self", "http://example.com/posts/1.json")
18                .attr("title", "Some blog post")
19                .attr("summary", "Here is the beginning of some blog post.")
20                .rel(
21                    "author",
22                    jsonapis::ResourceBuilder::new_with_id("users", "1")
23                        .link("self", "http://example.com/users/1.json")
24                        .attr("username", "alice"),
25                ),
26            jsonapis::ResourceBuilder::new_with_id("posts", "2")
27                .link("self", "http://example.com/posts/2.json")
28                .attr("title", "Other blog post")
29                .attr("summary", "Here is the beginning of other blog post.")
30                .rel(
31                    "author",
32                    jsonapis::ResourceBuilder::new_with_id("users", "2")
33                        .link("self", "http://example.com/users/2.json")
34                        .attr("username", "bob"),
35                ),
36        ])
37        .unwrap();
38
39    let expected_value = json!({
40        "jsonapi": json!({
41            "version": json!("1.0"),
42            "meta": json!(null),
43        }),
44        "meta": json!({
45            "current_page": json!(1),
46            "items_per_page": json!(2),
47            "total_pages": json!(3),
48            "total_items": json!(6),
49        }),
50        "links": json!({
51            "self": json!("http://example.com/posts.json?page=1"),
52            "related": json!(null),
53            "first": json!("http://example.com/posts.json?page=1"),
54            "last": json!("http://example.com/posts.json?page=3"),
55            "prev": json!(null),
56            "next": json!("http://example.com/posts.json?page=2"),
57            "about": json!(null),
58        }),
59        "data": json!([
60            json!({
61                "type": json!("posts"),
62                "id": json!("1"),
63                "meta": json!(null),
64                "links": json!({
65                    "self": json!("http://example.com/posts/1.json"),
66                    "related": json!(null),
67                    "first": json!(null),
68                    "last": json!(null),
69                    "prev": json!(null),
70                    "next": json!(null),
71                    "about": json!(null),
72                }),
73                "attributes": json!({
74                    "title": json!("Some blog post"),
75                    "summary": json!("Here is the beginning of some blog post."),
76                }),
77                "relationships": json!({
78                    "author": json!({
79                        "meta": json!(null),
80                        "links": json!(null),
81                        "data": json!({
82                            "type": json!("users"),
83                            "id": json!("1"),
84                            "meta": json!(null),
85                            "links": json!({
86                                "self": json!("http://example.com/users/1.json"),
87                                "related": json!(null),
88                                "first": json!(null),
89                                "last": json!(null),
90                                "prev": json!(null),
91                                "next": json!(null),
92                                "about": json!(null),
93                            }),
94                            "attributes": json!({
95                                "username": json!("alice"),
96                            }),
97                            "relationships": json!(null),
98                        }),
99                    }),
100                }),
101            }),
102            json!({
103                "type": json!("posts"),
104                "id": json!("2"),
105                "meta": json!(null),
106                "links": json!({
107                    "self": json!("http://example.com/posts/2.json"),
108                    "related": json!(null),
109                    "first": json!(null),
110                    "last": json!(null),
111                    "prev": json!(null),
112                    "next": json!(null),
113                    "about": json!(null),
114                }),
115                "attributes": json!({
116                    "title": json!("Other blog post"),
117                    "summary": json!("Here is the beginning of other blog post."),
118                }),
119                "relationships": json!({
120                    "author": json!({
121                        "meta": json!(null),
122                        "links": json!(null),
123                        "data": json!({
124                            "type": json!("users"),
125                            "id": json!("2"),
126                            "meta": json!(null),
127                            "links": json!({
128                                "self": json!("http://example.com/users/2.json"),
129                                "related": json!(null),
130                                "first": json!(null),
131                                "last": json!(null),
132                                "prev": json!(null),
133                                "next": json!(null),
134                                "about": json!(null),
135                            }),
136                            "attributes": json!({
137                                "username": json!("bob"),
138                            }),
139                            "relationships": json!(null),
140                        }),
141                    }),
142                }),
143            }),
144        ]),
145        "errors": json!(null),
146    });
147
148    let actual_json = serde_json::to_string(&document).unwrap();
149
150    let actual_value: Value = serde_json::from_str(&actual_json).unwrap();
151
152    println!("{:#?}", actual_value);
153
154    assert_eq!(actual_value, expected_value);
155}
Examples found in repository?
examples/builders.rs (line 11)
4fn main() {
5    let document = jsonapis::DocumentBuilder::default()
6        .jsonapi(jsonapis::Version::new(0))
7        .meta1("current_page", 1)
8        .meta1("items_per_page", 2)
9        .meta1("total_pages", 3)
10        .meta1("total_items", 6)
11        .link("self", "http://example.com/posts.json?page=1")
12        .link("first", "http://example.com/posts.json?page=1")
13        .link("last", "http://example.com/posts.json?page=3")
14        .link("next", "http://example.com/posts.json?page=2")
15        .data(vec![
16            jsonapis::ResourceBuilder::new_with_id("posts", "1")
17                .link("self", "http://example.com/posts/1.json")
18                .attr("title", "Some blog post")
19                .attr("summary", "Here is the beginning of some blog post.")
20                .rel(
21                    "author",
22                    jsonapis::ResourceBuilder::new_with_id("users", "1")
23                        .link("self", "http://example.com/users/1.json")
24                        .attr("username", "alice"),
25                ),
26            jsonapis::ResourceBuilder::new_with_id("posts", "2")
27                .link("self", "http://example.com/posts/2.json")
28                .attr("title", "Other blog post")
29                .attr("summary", "Here is the beginning of other blog post.")
30                .rel(
31                    "author",
32                    jsonapis::ResourceBuilder::new_with_id("users", "2")
33                        .link("self", "http://example.com/users/2.json")
34                        .attr("username", "bob"),
35                ),
36        ])
37        .unwrap();
38
39    let expected_value = json!({
40        "jsonapi": json!({
41            "version": json!("1.0"),
42            "meta": json!(null),
43        }),
44        "meta": json!({
45            "current_page": json!(1),
46            "items_per_page": json!(2),
47            "total_pages": json!(3),
48            "total_items": json!(6),
49        }),
50        "links": json!({
51            "self": json!("http://example.com/posts.json?page=1"),
52            "related": json!(null),
53            "first": json!("http://example.com/posts.json?page=1"),
54            "last": json!("http://example.com/posts.json?page=3"),
55            "prev": json!(null),
56            "next": json!("http://example.com/posts.json?page=2"),
57            "about": json!(null),
58        }),
59        "data": json!([
60            json!({
61                "type": json!("posts"),
62                "id": json!("1"),
63                "meta": json!(null),
64                "links": json!({
65                    "self": json!("http://example.com/posts/1.json"),
66                    "related": json!(null),
67                    "first": json!(null),
68                    "last": json!(null),
69                    "prev": json!(null),
70                    "next": json!(null),
71                    "about": json!(null),
72                }),
73                "attributes": json!({
74                    "title": json!("Some blog post"),
75                    "summary": json!("Here is the beginning of some blog post."),
76                }),
77                "relationships": json!({
78                    "author": json!({
79                        "meta": json!(null),
80                        "links": json!(null),
81                        "data": json!({
82                            "type": json!("users"),
83                            "id": json!("1"),
84                            "meta": json!(null),
85                            "links": json!({
86                                "self": json!("http://example.com/users/1.json"),
87                                "related": json!(null),
88                                "first": json!(null),
89                                "last": json!(null),
90                                "prev": json!(null),
91                                "next": json!(null),
92                                "about": json!(null),
93                            }),
94                            "attributes": json!({
95                                "username": json!("alice"),
96                            }),
97                            "relationships": json!(null),
98                        }),
99                    }),
100                }),
101            }),
102            json!({
103                "type": json!("posts"),
104                "id": json!("2"),
105                "meta": json!(null),
106                "links": json!({
107                    "self": json!("http://example.com/posts/2.json"),
108                    "related": json!(null),
109                    "first": json!(null),
110                    "last": json!(null),
111                    "prev": json!(null),
112                    "next": json!(null),
113                    "about": json!(null),
114                }),
115                "attributes": json!({
116                    "title": json!("Other blog post"),
117                    "summary": json!("Here is the beginning of other blog post."),
118                }),
119                "relationships": json!({
120                    "author": json!({
121                        "meta": json!(null),
122                        "links": json!(null),
123                        "data": json!({
124                            "type": json!("users"),
125                            "id": json!("2"),
126                            "meta": json!(null),
127                            "links": json!({
128                                "self": json!("http://example.com/users/2.json"),
129                                "related": json!(null),
130                                "first": json!(null),
131                                "last": json!(null),
132                                "prev": json!(null),
133                                "next": json!(null),
134                                "about": json!(null),
135                            }),
136                            "attributes": json!({
137                                "username": json!("bob"),
138                            }),
139                            "relationships": json!(null),
140                        }),
141                    }),
142                }),
143            }),
144        ]),
145        "errors": json!(null),
146    });
147
148    let actual_json = serde_json::to_string(&document).unwrap();
149
150    let actual_value: Value = serde_json::from_str(&actual_json).unwrap();
151
152    println!("{:#?}", actual_value);
153
154    assert_eq!(actual_value, expected_value);
155}
Source

pub fn error<E: Into<ErrorObjectBuilder>>(self, error_object: E) -> Self

Trait Implementations§

Source§

impl Builder<'_> for DocumentBuilder

Source§

type Entity = Document

Source§

fn finish(self) -> Result<Self::Entity, BuildErrors>

Source§

fn expect(self, msg: &str) -> Self::Entity

Source§

fn expect_err(self, msg: &str) -> BuildErrors

Source§

fn unwrap(self) -> Self::Entity

Source§

fn unwrap_err(self) -> BuildErrors

Source§

impl Clone for DocumentBuilder

Source§

fn clone(&self) -> DocumentBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DocumentBuilder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DocumentBuilder

Source§

fn default() -> DocumentBuilder

Returns the “default value” for a type. Read more
Source§

impl From<Document> for DocumentBuilder

Source§

fn from(document: Document) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for DocumentBuilder

Source§

fn eq(&self, other: &DocumentBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DocumentBuilder

Source§

impl StructuralPartialEq for DocumentBuilder

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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,