[][src]Function dishub::ops::add_feeds::verify_subject

pub fn verify_subject(subject: &str, tokens: &AppTokens) -> Result<(), Error>

Verify, whether the subject exists.

Examples

Existing subjects.

assert!(add_feeds::verify_subject("nabijaczleweli", &tokens).is_ok());
assert!(add_feeds::verify_subject("nabijaczleweli/dishub", &tokens).is_ok());

Non-existant subject.

assert_eq!(add_feeds::verify_subject("3f0ada6056fe3fc/67a6682230bf1cb6d", &tokens),
           Err(Error::WatchedDoesNotExist {
               tp: "repository",
               name: "3f0ada6056fe3fc/67a6682230bf1cb6d".to_string(),
           }));