Targets

The accounts to check, as given by the maintainer ({ github, open_collective }).

On this page

The accounts to check, as given by the maintainer ({ github, open_collective }).

Used by crate::server::verify_session; crate::Options has the same two fields.

use sponsorkit::Targets;

pub struct Targets {
    pub github: Option<String>,
    pub open_collective: Option<String>,
}

Fields#

github#

pub github: Option<String>

GitHub Sponsors login (user or organization).

open_collective#

pub open_collective: Option<String>

Open Collective collective slug.

Methods#

github#

pub fn github(login: impl Into<String>) -> Self

A target set with only a GitHub login.

ParameterType
loginimpl Into<String>

Returns: Self

open_collective#

pub fn open_collective(slug: impl Into<String>) -> Self

A target set with only an Open Collective slug.

ParameterType
slugimpl Into<String>

Returns: Self

with_github#

pub fn with_github(self, login: impl Into<String>) -> Self

Adds (or replaces) the GitHub login.

ParameterType
loginimpl Into<String>

Returns: Self

with_open_collective#

pub fn with_open_collective(self, slug: impl Into<String>) -> Self

Adds (or replaces) the Open Collective slug.

ParameterType
slugimpl Into<String>

Returns: Self

canonical#

pub fn canonical(&self) -> Result<TargetSet>

Validates and canonicalizes this set.

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

Trait implementations#

  • impl Clone for Targets
  • impl Debug for Targets
  • impl Default for Targets
  • impl Eq for Targets
  • impl PartialEq for Targets