pub struct ListTasksResponse {
pub tasks: Vec<Task>,
pub next_page_token: String,
pub page_size: u32,
pub total_size: u32,
}Expand description
A typed ListTasks response. Wire form:
{
"tasks": [Task, ...],
"nextPageToken": "...",
"pageSize": 50,
"totalSize": 123
}tasks is required (but may be empty).
nextPageToken is required: the spec
uses an empty string to mean “no more
pages”, which is the spec’s idiomatic
way of expressing the absence. The Rust
type mirrors that with a String (not
an Option<String>).
pageSize and totalSize are also
required. The spec names them as
required fields.
Fields§
§tasks: Vec<Task>The tasks. An empty list is a valid response (no tasks matched the filters).
next_page_token: StringA token to retrieve the next page of results, or an empty string if there are no more results. The spec requires this field; an empty string is the absence signal.
page_size: u32The page size used for this
response. The spec requires this
field; a value of 0 is a malformed
response (the page size is at least
1 per the spec).
total_size: u32The total number of tasks available before pagination. The spec requires this field.
Implementations§
Source§impl ListTasksResponse
impl ListTasksResponse
Sourcepub fn new(tasks: impl IntoIterator<Item = Task>) -> Self
pub fn new(tasks: impl IntoIterator<Item = Task>) -> Self
Starts a new response with tasks.
Use with_next_page_token,
with_page_size,
and with_total_size
to set the required metadata fields.
Sourcepub fn with_next_page_token(self, next_page_token: impl Into<String>) -> Self
pub fn with_next_page_token(self, next_page_token: impl Into<String>) -> Self
Sets the next page token. An empty string is the spec’s “no more pages” signal.
Sourcepub const fn with_page_size(self, page_size: u32) -> Self
pub const fn with_page_size(self, page_size: u32) -> Self
Sets the page size.
Sourcepub const fn with_total_size(self, total_size: u32) -> Self
pub const fn with_total_size(self, total_size: u32) -> Self
Sets the total size.