pub struct SlackApp<R: ResourceUsageRepository> {
pub grant_access_usecase: Arc<GrantUserResourceAccessUseCase>,
pub create_resource_usage_usecase: Arc<CreateResourceUsageUseCase<R>>,
pub update_resource_usage_usecase: Arc<UpdateResourceUsageUseCase<R>>,
pub delete_usage_usecase: Arc<DeleteResourceUsageUseCase<R>>,
pub identity_repo: Arc<dyn IdentityLinkRepository>,
pub resource_config: Arc<ResourceConfig>,
pub slack_client: Arc<SlackHyperClient>,
pub bot_token: SlackApiToken,
pub user_channel_map: Arc<RwLock<HashMap<SlackUserId, SlackChannelId>>>,
pub task_tracker: TaskTracker,
pub http_client: Client,
}Expand description
依存性注入を備えたSlackアプリケーション
Slackインタラクションに必要なすべての依存関係を保持します。
Fields§
§grant_access_usecase: Arc<GrantUserResourceAccessUseCase>§create_resource_usage_usecase: Arc<CreateResourceUsageUseCase<R>>§update_resource_usage_usecase: Arc<UpdateResourceUsageUseCase<R>>§delete_usage_usecase: Arc<DeleteResourceUsageUseCase<R>>§identity_repo: Arc<dyn IdentityLinkRepository>§resource_config: Arc<ResourceConfig>§slack_client: Arc<SlackHyperClient>§bot_token: SlackApiToken§user_channel_map: Arc<RwLock<HashMap<SlackUserId, SlackChannelId>>>§task_tracker: TaskTracker§http_client: ClientImplementations§
Source§impl<R: ResourceUsageRepository + Send + Sync + 'static> SlackApp<R>
impl<R: ResourceUsageRepository + Send + Sync + 'static> SlackApp<R>
Sourcepub fn new(
grant_access_usecase: Arc<GrantUserResourceAccessUseCase>,
create_resource_usage_usecase: Arc<CreateResourceUsageUseCase<R>>,
update_resource_usage_usecase: Arc<UpdateResourceUsageUseCase<R>>,
delete_usage_usecase: Arc<DeleteResourceUsageUseCase<R>>,
identity_repo: Arc<dyn IdentityLinkRepository>,
resource_config: Arc<ResourceConfig>,
slack_client: Arc<SlackHyperClient>,
bot_token: SlackApiToken,
) -> Self
pub fn new( grant_access_usecase: Arc<GrantUserResourceAccessUseCase>, create_resource_usage_usecase: Arc<CreateResourceUsageUseCase<R>>, update_resource_usage_usecase: Arc<UpdateResourceUsageUseCase<R>>, delete_usage_usecase: Arc<DeleteResourceUsageUseCase<R>>, identity_repo: Arc<dyn IdentityLinkRepository>, resource_config: Arc<ResourceConfig>, slack_client: Arc<SlackHyperClient>, bot_token: SlackApiToken, ) -> Self
新しいSlackAppを作成
§引数
grant_access_usecase- ユーザーアクセス権限付与UseCasecreate_resource_usage_usecase- リソース使用予定作成UseCaseupdate_resource_usage_usecase- リソース使用予定更新UseCasedelete_usage_usecase- リソース使用予定削除UseCaseidentity_repo- ID紐付けリポジトリresource_config- リソース設定slack_client- Slackクライアントbot_token- Bot Token
Source§impl<R: ResourceUsageRepository + Send + Sync + 'static> SlackApp<R>
impl<R: ResourceUsageRepository + Send + Sync + 'static> SlackApp<R>
Sourcepub async fn route_slash_command(
&self,
event: SlackCommandEvent,
) -> Result<SlackCommandEventResponse, Box<dyn Error + Send + Sync>>
pub async fn route_slash_command( &self, event: SlackCommandEvent, ) -> Result<SlackCommandEventResponse, Box<dyn Error + Send + Sync>>
Sourcepub async fn route_interaction(
&self,
event: SlackInteractionEvent,
) -> Result<Option<SlackViewSubmissionResponse>, Box<dyn Error + Send + Sync>>
pub async fn route_interaction( &self, event: SlackInteractionEvent, ) -> Result<Option<SlackViewSubmissionResponse>, Box<dyn Error + Send + Sync>>
Auto Trait Implementations§
impl<R> Freeze for SlackApp<R>
impl<R> !RefUnwindSafe for SlackApp<R>
impl<R> Send for SlackApp<R>
impl<R> Sync for SlackApp<R>
impl<R> Unpin for SlackApp<R>
impl<R> !UnwindSafe for SlackApp<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more