> For the complete documentation index, see [llms.txt](https://doc.cess.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/file_bank/file.md).

# File

The `file` is used to query file metadata information.

```rust
/// Asynchronously retrieves the `FileInfo` associated with a given hash, and optionally
/// verifies it against a specified block hash.
///
/// # Parameters
/// - `hash`: A string slice that holds the hash identifier for the file.
/// - `block_hash`: An optional `H256` hash representing the block hash to verify the file against.
///
/// # Returns
/// A `Result` which is:
/// - `Ok(Some(FileInfo))` if the file is found and successfully retrieved.
/// - `Ok(None)` if the file is not found.
/// - `Err(Box<dyn std::error::Error>)` if there is an error during retrieval.
///
pub async fn file(
    hash: &str,
    block_hash: Option<H256>,
) -> Result<Option<FileInfo>, Box<dyn std::error::Error>>
```
