pub struct ToolkitListBuilder<'a> { /* private fields */ }Expand description
Builder for listing toolkits with filtering options
This builder provides a fluent API for configuring toolkit listing requests. It supports pagination, filtering by connection status, searching, and filtering by specific toolkit slugs.
§Example
let session = client.create_session("user_123").send().await?;
// List first 10 connected toolkits
let toolkits = session.list_toolkits()
.limit(10)
.is_connected(true)
.send()
.await?;
// Paginate through results
let mut cursor = None;
loop {
let mut builder = session.list_toolkits().limit(20);
if let Some(c) = cursor {
builder = builder.cursor(c);
}
let response = builder.send().await?;
// Process response.items...
cursor = response.next_cursor;
if cursor.is_none() {
break;
}
}Implementations§
Source§impl<'a> ToolkitListBuilder<'a>
impl<'a> ToolkitListBuilder<'a>
Sourcepub fn cursor(self, cursor: impl Into<String>) -> Self
pub fn cursor(self, cursor: impl Into<String>) -> Self
Set the pagination cursor
Use the next_cursor value from a previous response to fetch
the next page of results.
§Arguments
cursor- Pagination cursor from previous response
§Example
let first_page = session.list_toolkits().limit(20).send().await?;
if let Some(cursor) = first_page.next_cursor {
let second_page = session.list_toolkits()
.limit(20)
.cursor(cursor)
.send()
.await?;
}Sourcepub fn is_connected(self, is_connected: bool) -> Self
pub fn is_connected(self, is_connected: bool) -> Self
Filter by connection status
When set to true, only returns toolkits that have an active
connected account. When set to false, only returns toolkits
without a connected account.
§Arguments
is_connected- Whether to filter by connection status
§Example
// Get only connected toolkits
let connected = session.list_toolkits()
.is_connected(true)
.send()
.await?;
// Get only disconnected toolkits
let disconnected = session.list_toolkits()
.is_connected(false)
.send()
.await?;Sourcepub async fn send(self) -> Result<ToolkitListResponse, ComposioError>
pub async fn send(self) -> Result<ToolkitListResponse, ComposioError>
Execute the toolkit listing request
Sends the request to the Composio API and returns the list of toolkits matching the configured filters.
§Errors
Returns an error if:
- The API request fails
- The response cannot be parsed
- Authentication is invalid
§Example
let response = session.list_toolkits()
.limit(10)
.is_connected(true)
.send()
.await?;
println!("Found {} toolkits", response.items.len());
println!("Total: {}", response.total_items);
println!("Page {} of {}", response.current_page, response.total_pages);
for toolkit in response.items {
println!("- {} ({})", toolkit.name, toolkit.slug);
if let Some(account) = toolkit.connected_account {
println!(" Connected: {} ({})", account.id, account.status);
}
}Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ToolkitListBuilder<'a>
impl<'a> !RefUnwindSafe for ToolkitListBuilder<'a>
impl<'a> Send for ToolkitListBuilder<'a>
impl<'a> Sync for ToolkitListBuilder<'a>
impl<'a> Unpin for ToolkitListBuilder<'a>
impl<'a> UnsafeUnpin for ToolkitListBuilder<'a>
impl<'a> !UnwindSafe for ToolkitListBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more