Struct fluvio_index::Package

source ·
pub struct Package {
    pub name: PackageName,
    pub group: GroupName,
    pub kind: PackageKind,
    pub author: Option<String>,
    pub description: Option<String>,
    pub repository: Option<String>,
    /* private fields */
}
Expand description

A Package represents a single published item in Fluvio’s registry.

Each time you publish an updated version of a package, that version is known as a Release.

A package has a specified type, and all releases of that package must be the same type.

Fields§

§name: PackageName

The unique name of this package

§group: GroupName

The ID of the group that published the package

§kind: PackageKind

The type of package this is

§author: Option<String>

The author of this package

§description: Option<String>

The human-readable description of this package

§repository: Option<String>

A link to the source code repository of this package

Implementations§

source§

impl Package

source

pub fn new_binary<V>( id: &PackageId<V>, author: impl Into<String>, desc: impl Into<String>, repo: impl Into<String> ) -> Self

source

pub fn latest_release(&self) -> Result<&Release>

Returns a reference to the latest release for this package

source

pub fn latest_release_for_target( &self, target: &Target, prerelease: bool ) -> Result<&Release>

Returns a reference to the latest release with this target

If prerelease is false, this will return only the latest release whose version does not include a prerelease tag.

source

pub fn add_release(&mut self, version: Version, target: Target) -> Result<()>

Adds a new release to this package. This will reject a release if a release by the same version exists.

source

pub fn releases_for_target(&self, target: &Target) -> Vec<&Release>

Trait Implementations§

source§

impl Debug for Package

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Package

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Package

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

§

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>,

§

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> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,