pub struct Registry { /* private fields */ }
Implementations§
source§impl Registry
impl Registry
sourcepub fn new_handle(
host: String,
token: Option<String>,
handle: Easy,
auth_required: bool,
) -> Registry
pub fn new_handle( host: String, token: Option<String>, handle: Easy, auth_required: bool, ) -> Registry
Creates a new Registry
.
§Example
use curl::easy::Easy;
use crates_io::Registry;
let mut handle = Easy::new();
// If connecting to crates.io, a user-agent is required.
handle.useragent("my_crawler (example.com/info)");
let mut reg = Registry::new_handle(String::from("https://crates.io"), None, handle, true);
pub fn set_token(&mut self, token: Option<String>)
pub fn host(&self) -> &str
pub fn host_is_crates_io(&self) -> bool
pub fn add_owners(&mut self, krate: &str, owners: &[&str]) -> Result<String>
pub fn remove_owners(&mut self, krate: &str, owners: &[&str]) -> Result<()>
pub fn list_owners(&mut self, krate: &str) -> Result<Vec<User>>
pub fn publish(&mut self, krate: &NewCrate, tarball: &File) -> Result<Warnings>
pub fn search(&mut self, query: &str, limit: u32) -> Result<(Vec<Crate>, u32)>
pub fn yank(&mut self, krate: &str, version: &str) -> Result<()>
pub fn unyank(&mut self, krate: &str, version: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl !Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more