Struct libcnb::data::buildpack::BuildpackId[][src]

pub struct BuildpackId(_);

buildpack.toml Buildpack Id. This is a newtype wrapper around a String. It MUST only contain numbers, letters, and the characters ., /, and -. It also cannot be config or app. Use std::str::FromStr to create a new instance of this struct.

Examples

use std::str::FromStr;
use libcnb::data::buildpack::BuildpackId;

let valid = BuildpackId::from_str("heroku/ruby-engine.MRI3");
assert_eq!(valid.unwrap().as_str(), "heroku/ruby-engine.MRI3");

let invalid = BuildpackId::from_str("!nvalid");
assert!(invalid.is_err());

Implementations

impl BuildpackId[src]

pub fn as_str(&self) -> &str[src]

Trait Implementations

impl Debug for BuildpackId[src]

impl<'de> Deserialize<'de> for BuildpackId[src]

impl FromStr for BuildpackId[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

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.

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.