Struct palletizer::Registry[][src]

pub struct Registry { /* fields omitted */ }

Implementations

impl Registry[src]

pub fn init(path: impl AsRef<Path>, config: Config) -> Result<Self, Error>[src]

Initialize a new registry with a config file.

pub fn open(path: impl AsRef<Path>) -> Result<Self, Error>[src]

Open an existing registry.

pub fn path(&self) -> &Path[src]

Get the path of the registry.

pub fn index_repo(&self) -> &Repository[src]

Get the git repository of the index.

pub fn index_dir(&self) -> PathBuf[src]

Get the path of the index repository.

pub fn crate_dir(&self) -> PathBuf[src]

Get the path of the crate directory.

pub fn add_crate_with_metadata(
    &mut self,
    metadata: &Entry,
    data: &[u8]
) -> Result<(), Error>
[src]

Add a crate to the registry using the supplied metadata.

pub fn add_crate(&mut self, data: &[u8]) -> Result<(), Error>[src]

Add a crate to the registry.

You must pass the path to a crate as packaged by cargo package.

pub fn add_crate_from_file(
    &mut self,
    path: impl AsRef<Path>
) -> Result<(), Error>
[src]

Add a crate to the registry.

You must pass the path to a crate as packaged by cargo package.

pub fn yank_crate(&mut self, name: &str, version: &str) -> Result<bool, Error>[src]

Yank a crate from the registry.

Returns true if the crate was yanked, and false if the crate was already yanked.

If the crate is not found or if an other error occures, an error is returned.

pub fn unyank_crate(&mut self, name: &str, version: &str) -> Result<bool, Error>[src]

Unyank a crate from the registry.

Returns true if the crate was unyanked, and false if the crate was already unyanked.

If the crate is not found or if an other error occures, an error is returned.

Trait Implementations

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.