[−][src]Trait zotero::Get
Perform get operations on Zotero items and collections.
use zotero::ZoteroInit; use zotero::Get; let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let items = z.get_items(None);
Required methods
fn get_request<S: AsRef<str> + Display>(
&self,
params: S,
extra_params: Option<&str>
) -> Result<Value, Box<dyn Error>>
&self,
params: S,
extra_params: Option<&str>
) -> Result<Value, Box<dyn Error>>
fn get_id(&self) -> &'a str
fn get_api_key(&self) -> &'a str
Provided methods
fn get_api_key_info<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Value, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Value, Box<dyn Error>>
Retreive information about an api key and it's privileges.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collection = z.get_api_key_info("bZARysJ579K5SdmYuaAJ");
fn get_item<I: Into<Option<&'a str>>>(
&self,
item_id: &'a str,
extra_params: I
) -> Result<Item, Box<dyn Error>>
&self,
item_id: &'a str,
extra_params: I
) -> Result<Item, Box<dyn Error>>
Retreive specific item in the library by it's ID.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let items = z.get_item("B8ZNE3GH", None);
fn get_items<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive all items in the library, excluding trashed items.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let items = z.get_items(None);
fn get_top_items<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive top-level items in the library, excluding trashed items.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let top_items = z.get_top_items(None);
fn get_trashed_items<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive items in the trash.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let trashed_items = z.get_trashed_items(None);
fn get_publications<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive items in "My publications".
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let my_publications = z.get_publications(None);
fn get_collection<I: Into<Option<&'a str>>>(
&self,
collection_id: &'a str,
extra_params: I
) -> Result<Collection, Box<dyn Error>>
&self,
collection_id: &'a str,
extra_params: I
) -> Result<Collection, Box<dyn Error>>
Retreive a collection by it's id.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collection = z.get_collection("AYVWED", None);
fn get_collection_by_name<I: Into<Option<&'a str>>>(
&self,
collection_name: &'a str,
extra_params: I
) -> Result<Option<Collection>, Box<dyn Error>>
&self,
collection_name: &'a str,
extra_params: I
) -> Result<Option<Collection>, Box<dyn Error>>
Retreive a collection by it's name.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collection = z.get_collection_by_name("My collection", None);
fn get_collections_by_names<I: Into<Option<&'a str>>>(
&self,
collection_names: Vec<&'a str>,
extra_params: I
) -> Result<Option<Vec<Collection>>, Box<dyn Error>>
&self,
collection_names: Vec<&'a str>,
extra_params: I
) -> Result<Option<Vec<Collection>>, Box<dyn Error>>
Retreive a set of collections by their names.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collections = z.get_collections_by_names(vec!("My collection", "My other collection"), None);
fn get_collections<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Vec<Collection>, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Vec<Collection>, Box<dyn Error>>
Retreive all collections.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collections = z.get_collections(None);
fn get_top_collections<I: Into<Option<&'a str>>>(
&self,
extra_params: I
) -> Result<Vec<Collection>, Box<dyn Error>>
&self,
extra_params: I
) -> Result<Vec<Collection>, Box<dyn Error>>
Retreive top level collections.
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let top_collections = z.get_top_collections(None);
fn get_collection_items<I: Into<Option<&'a str>>>(
&self,
collection_id: &'a str,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
collection_id: &'a str,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive all items for a given collection
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collection_items = z.get_collection_items("AYVWED", None);
fn get_collection_top_items<I: Into<Option<&'a str>>>(
&self,
collection_id: &'a str,
item_id: &'a str,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
collection_id: &'a str,
item_id: &'a str,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive top-level items for a given collection
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let collection_top_items = z.get_collection_top_items("AYVWED", "B8ZNE3GH", None);
fn get_subset<I: Into<Option<&'a str>>>(
&self,
item_ids: Vec<&'a str>,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
&self,
item_ids: Vec<&'a str>,
extra_params: I
) -> Result<Vec<Item>, Box<dyn Error>>
Retreive up to 50 items by their ids
let z = ZoteroInit::set_user("123456789", "bZARysJ579K5SdmYuaAJ"); let items = z.get_subset(vec!("AYVWED", "B8ZNE3GH"), None);