docs: Document arguments and returns for utility and filter functions
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -4,6 +4,19 @@ use axum::http::StatusCode;
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// Check if content is binary when allow_binary is false
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `item_service` - Reference to the async item service
|
||||
/// * `item_id` - The ID of the item to check
|
||||
/// * `metadata` - Metadata associated with the item
|
||||
/// * `allow_binary` - Whether binary content is allowed
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// * `Result<(), StatusCode>` -
|
||||
/// * `Ok(())` if binary content is allowed or content is not binary
|
||||
/// * `Err(StatusCode::BAD_REQUEST)` if binary content is not allowed and content is binary
|
||||
pub async fn check_binary_content_allowed(
|
||||
item_service: &AsyncItemService,
|
||||
item_id: i64,
|
||||
@@ -20,6 +33,19 @@ pub async fn check_binary_content_allowed(
|
||||
}
|
||||
|
||||
/// Helper function to determine if content is binary
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `item_service` - Reference to the async item service
|
||||
/// * `item_id` - The ID of the item to check
|
||||
/// * `metadata` - Metadata associated with the item
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// * `Result<bool, StatusCode>` -
|
||||
/// * `Ok(true)` if content is binary
|
||||
/// * `Ok(false)` if content is text
|
||||
/// * `Err(StatusCode)` if an error occurs during checking
|
||||
pub async fn is_content_binary(
|
||||
item_service: &AsyncItemService,
|
||||
item_id: i64,
|
||||
|
||||
Reference in New Issue
Block a user