crates_io

Struct Registry

Source
pub struct Registry { /* private fields */ }

Implementations§

Source§

impl Registry

Source

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);
Source

pub fn set_token(&mut self, token: Option<String>)

Source

pub fn host(&self) -> &str

Source

pub fn host_is_crates_io(&self) -> bool

Source

pub fn add_owners(&mut self, krate: &str, owners: &[&str]) -> Result<String>

Source

pub fn remove_owners(&mut self, krate: &str, owners: &[&str]) -> Result<()>

Source

pub fn list_owners(&mut self, krate: &str) -> Result<Vec<User>>

Source

pub fn publish(&mut self, krate: &NewCrate, tarball: &File) -> Result<Warnings>

Source

pub fn search(&mut self, query: &str, limit: u32) -> Result<(Vec<Crate>, u32)>

Source

pub fn yank(&mut self, krate: &str, version: &str) -> Result<()>

Source

pub fn unyank(&mut self, krate: &str, version: &str) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T