Skip to main content

ToolkitListBuilder

Struct ToolkitListBuilder 

Source
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>

Source

pub fn limit(self, limit: u32) -> Self

Set the maximum number of toolkits to return

§Arguments
  • limit - Maximum number of toolkits (default: 20)
§Example
let toolkits = session.list_toolkits()
    .limit(50)
    .send()
    .await?;
Source

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?;
}
Source

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

Filter by specific toolkit slugs

Only return toolkits matching the provided slugs.

§Arguments
  • toolkits - List of toolkit slugs to filter by
§Example
let toolkits = session.list_toolkits()
    .toolkits(vec!["github", "gmail", "slack"])
    .send()
    .await?;
Source

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?;
Source

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

Search toolkits by name or slug

Returns toolkits whose name or slug contains the search query (case-insensitive).

§Arguments
  • search - Search query string
§Example
let github_toolkits = session.list_toolkits()
    .search("github")
    .send()
    .await?;
Source

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§

Source§

impl<'a> Debug for ToolkitListBuilder<'a>

Source§

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

Formats the value using the given formatter. Read more

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> 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> 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