# Coding Standards
This document outlines coding standards for the Ostium Rust SDK.
## Code Style
### Formatting
- Use `cargo fmt` for consistent formatting
- Follow Rust standard naming conventions
- Use descriptive variable and function names
### Documentation
- Document all public APIs with doc comments
- Include examples in documentation
- Keep comments up to date
### Error Handling
- Use the `Result` type for fallible operations
- Provide meaningful error messages
- Use structured error types
## Example
```rust
/// Retrieves the current price for a trading pair.
///
/// # Arguments
///
/// * `symbol` - The trading pair symbol (e.g., "BTC/USD")
///
/// # Returns
///
/// Returns the current price information or an error if the request fails.
///
/// # Example
///
/// ```rust
/// let price = client.get_price("BTC/USD").await?;
/// println!("BTC price: ${}", price.mark_price);
/// ```
pub async fn get_price(&self, symbol: &str) -> Result<Price> {
// Implementation
}
```
## Testing
- Write unit tests for all public functions
- Use integration tests for end-to-end scenarios
- Mock external dependencies when appropriate
## See Also
- [Development Setup](development.md) - Development environment
- [Testing Guidelines](testing.md) - Testing best practices