# Delete Bucket

The `delete_bucket` creates transaction to delete the bucket. The prerequisite for deleting a bucket is that there are no files in the bucket before the bucket can be deleted.

```rust
/// Creates a transaction to delete the specified bucket under the given account.
///
/// # Parameters
///
/// - `account`: The identifier of the account under which the bucket exists.
/// - `bucket_name`: The name of the bucket to be deleted. The bucket must be empty before it can be deleted.
///
/// # Returns
///
/// Returns a `Result` that, on success, contains a tuple with:
/// - `TxHash`: The transaction hash associated with the deletion of the bucket.
/// - `DeleteBucket`: A structure representing the result of the bucket deletion.
///
pub async fn delete_bucket(
    &self,
    account: &str,
    bucket_name: &str,
) -> Result<(TxHash, DeleteBucket), Box<dyn std::error::Error>>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/file_bank/delete_bucket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
