Skip to main content

GitHubProjectsSource

Struct GitHubProjectsSource 

Source
pub struct GitHubProjectsSource { /* private fields */ }
Expand description

A source which reads GitHub afresh for every operation.

Implementations§

Source§

impl GitHubProjectsSource

Source

pub fn new( name: &SourceName, config: GitHubProjectsConfig, secrets: &dyn SecretResolver, ) -> Result<Self, SourceError>

Validate configuration and capture the named credential without exposing it.

§Errors

Returns SourceError::Config for a configuration this instance cannot use and SourceError::Auth when the named credential is missing or empty.

Source

pub fn recording_into( name: &SourceName, config: GitHubProjectsConfig, secrets: &dyn SecretResolver, ledger: Arc<Accounting>, ) -> Result<Self, SourceError>

The same, recording every request it sends into an accounting the caller holds too.

Self::new is this with an accounting of its own. A caller that is also making its own calls to GitHub — a lane verifying a schema, sweeping residue or cleaning up — passes the one it records those into, so the session total accounts for the whole session rather than for this source’s share of it.

§Errors

Exactly Self::new’s: SourceError::Config for a configuration this instance cannot use and SourceError::Auth when the named credential is missing or empty.

Source

pub fn accounting(&self) -> Session

A snapshot of every request this source has sent, and what each cost.

A value to hold and compare rather than a borrow of the accounting itself, so two of them can sit side by side. When this source was built with Self::recording_into the snapshot is the whole shared session, which is the point of building it that way.

Trait Implementations§

Source§

impl TaskSource for GitHubProjectsSource

Source§

fn write_document<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Document>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or update one document, which is one issue titled the way this board spells a document.

Everything else is exactly a task write: caller metadata goes to the same canonical JSON slot at the end of the body and comes back with its JSON types intact, a key or a field this board cannot carry is refused by name rather than dropped, a target naming an issue this board does not hold is refused rather than created, and an issue this call created is taken back when the rest of the write fails.

Source§

fn kind(&self) -> &'static str

The plugin kind that built this source, for display and for plan output.
Source§

fn capabilities(&self) -> Capabilities

What this source applies itself. Read once per query by the engine.
Source§

fn health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Health, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether the source is answering right now. Read more
Source§

fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch one task by its native id, or None when there is no such task. Read more
Source§

fn get_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch one project by its native id, or None when there is no such project. Read more
Source§

fn query_tasks<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 TaskQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Task>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the tasks matching query. Read more
Source§

fn query_projects<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 ProjectQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Project>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the projects matching query. Read more
Source§

fn get_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch one document by its native id, or None when there is no such document. Read more
Source§

fn query_documents<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 DocumentQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Document>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the documents matching query. Read more
Source§

fn labels<'life0, 'life1, 'async_trait>( &'life0 self, page: &'life1 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Label>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

One page of every label this source knows. Read more
Source§

fn task_dependencies<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, direction: Direction, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the task dependency edges at id, in direction. Read more
Source§

fn project_dependencies<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, direction: Direction, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the project dependency edges at id, in direction. Read more
Source§

fn writes(&self) -> WriteSupport

Whether this source can be written through at all. Read more
Source§

fn write_task<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Task>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or update one task, answering with the native id the destination holds it under. Read more
Source§

fn write_project<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Project>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or update one project, on exactly the terms of write_task. Read more
Source§

fn delete_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one task this destination holds, so a copy that could not finish can put the destination back the way it found it. Read more
Source§

fn delete_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one project this destination holds, on exactly the terms of delete_task. Read more
Source§

fn delete_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one document this destination holds, on exactly the terms of delete_task. 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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