Target

One normalized target.

On this page

One normalized target.

use sponsorkit::Target;

pub struct Target {
    pub provider: Provider,
    pub account: String,
}

Fields#

provider#

pub provider: Provider

The provider.

account#

pub account: String

The lowercased, trimmed login or slug.

Methods#

new#

pub fn new(provider: Provider, account: &str) -> Result<Target>

Normalizes (trim + lowercase) and validates an account for a provider.

Returns an invalid_config error for malformed accounts.

ParameterType
providerProvider
account&str

Returns: Result<Target> (see Result, Target)

parse#

pub fn parse(s: &str) -> Result<Target>

Parses "<provider>:<account>".

ParameterType
s&str

Returns: Result<Target> (see Result, Target)

Trait implementations#

  • impl Clone for Target
  • impl Debug for Target
  • impl Display for Target
  • impl Eq for Target
  • impl Hash for Target
  • impl PartialEq for Target