Skip to main content

search_uri

Function search_uri 

Source
pub fn search_uri(path: &str, keyword: &str, case_folding: bool) -> String
Expand description

Builds the URI that asks the server to search instead of list

Cloudreve expresses “search under this folder” as a URI carrying its own query string. Since that query rides inside the uri parameter of the request, every path segment is encoded here and the whole URI gets encoded again by the caller — otherwise the inner ? would terminate the outer query and the server would see a plain listing request.

§Arguments

  • path - Folder to search under; empty or “/” searches the whole drive
  • keyword - Name fragment to look for
  • case_folding - Match regardless of letter case

§Examples

use cloudreve_api::api::v4::uri::search_uri;

assert_eq!(
    search_uri("/photos", "cat", true),
    "cloudreve://my/photos?name=cat&case_folding=true"
);