### start Source: https://docs.rs/slack-morphism/latest/slack_morphism/socket_mode/clients_manager/trait.SlackSocketModeClientsManager.html Starts the Slack Socket Mode clients manager. ```APIDOC ## start ### Description Starts the Slack Socket Mode clients manager. ### Method Signature ```rust fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` ``` -------------------------------- ### SlackClientSocketModeListener::start Source: https://docs.rs/slack-morphism/latest/slack_morphism/socket_mode/struct.SlackClientSocketModeListener.html Starts the socket mode listener. ```APIDOC ## SlackClientSocketModeListener::start ### Description Starts the socket mode listener. This method typically initializes the necessary components and begins the event loop. ### Returns - `()`: This method does not return a value upon successful execution. ``` -------------------------------- ### RwLock::get_mut Example Source: https://docs.rs/slack-morphism/latest/slack_morphism/listener/type.SlackClientEventsUserState.html Demonstrates safely getting a mutable reference to the data inside an RwLock. This method requires exclusive access and will return None if the RwLock has been cloned. ```rust let mut lock = RwLock::::new(0); *lock.get_mut().unwrap() += 5; assert_eq!(lock.try_unwrap().unwrap(), 5); ``` -------------------------------- ### Iterating over slice chunks from the end (rchunks) Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `rchunks` to get an iterator over mutable slices of a specified size, starting from the end. The last chunk may be smaller if the slice length is not divisible by `chunk_size`. ```rust let slice = ['l', 'o', 'r', 'e', 'm']; let mut iter = slice.rchunks(2); assert_eq!(iter.next().unwrap(), &['e', 'm']); assert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none()); ``` -------------------------------- ### SlackStarsItemIm Constructor and Methods Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackStarsItemIm.html Provides details on how to create and manipulate SlackStarsItemIm instances. Includes a constructor and methods for setting channel and creation date. ```APIDOC ### impl SlackStarsItemIm #### pub fn new(channel: SlackChannelId, date_create: SlackDateTime) -> Self Creates a new `SlackStarsItemIm` instance. #### pub fn channel(&mut self, value: SlackChannelId) -> &mut Self Sets the `channel` field for the `SlackStarsItemIm` instance. #### pub fn with_channel(self, value: SlackChannelId) -> Self Creates a new `SlackStarsItemIm` instance with the specified `channel`. #### pub fn date_create(&mut self, value: SlackDateTime) -> &mut Self Sets the `date_create` field for the `SlackStarsItemIm` instance. #### pub fn with_date_create(self, value: SlackDateTime) -> Self Creates a new `SlackStarsItemIm` instance with the specified `date_create`. ``` -------------------------------- ### Initialize SlackAppManifestFeaturesSlashCommand Source: https://docs.rs/slack-morphism/latest/slack_morphism/apps/manifest/struct.SlackAppManifestFeaturesSlashCommand.html Creates a new instance of SlackAppManifestFeaturesSlashCommand with the required command and description fields. ```rust pub fn new(command: String, description: String) -> Self ``` -------------------------------- ### Implement From for SlackChannelDetails Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackChannelDetailsInit.html Provides a conversion from SlackChannelDetailsInit to SlackChannelDetails. This allows for easy initialization of SlackChannelDetails using a SlackChannelDetailsInit instance. ```rust impl From for SlackChannelDetails { fn from(value: SlackChannelDetailsInit) -> Self { // Implementation details would go here } } ``` -------------------------------- ### Get Type ID Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackAppManifestFeaturesAppHome.html Gets the TypeId of a static object. ```rust fn type_id(&self) -> TypeId where T: 'static + ?Sized, ``` -------------------------------- ### Start Slack Socket Mode Client Manager Source: https://docs.rs/slack-morphism/latest/slack_morphism/socket_mode/clients_manager/trait.SlackSocketModeClientsManager.html Starts the Slack Socket Mode client manager. This method returns a future that resolves to `()`, indicating the manager has started. ```rust fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### New SlackStarsItemFile Constructor Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackStarsItemFile.html Creates a new instance of SlackStarsItemFile with the provided file, channel, and creation date. ```rust pub fn new( file: SlackFile, channel: SlackChannelId, date_create: SlackDateTime, ) -> Self ``` -------------------------------- ### Getting Slice Length Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Illustrates how to get the number of elements in a slice using `len()`. ```rust let a = [1, 2, 3]; assert_eq!(a.len(), 3); ``` -------------------------------- ### Create SlackApiChatUnfurlMapItemV2 with preview Source: https://docs.rs/slack-morphism/latest/slack_morphism/api/struct.SlackApiChatUnfurlMapItemV2.html Use `with_preview` for an immutable way to set the preview. ```rust pub fn with_preview(self, value: SlackApiChatUnfurlPreview) -> Self ``` -------------------------------- ### SlackTeamLimits::new Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackTeamLimits.html Constructs a new `SlackTeamLimits` instance, initializing it based on the provided `SlackApiRateControlConfig`. ```APIDOC ## impl SlackTeamLimits ### pub fn new(rate_control_config: &SlackApiRateControlConfig) -> Self Creates a new `SlackTeamLimits` instance initialized with rate control configuration. ``` -------------------------------- ### Start Date Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackUserProfile.html Methods for setting, resetting, and optionally managing the user's start date. ```APIDOC ## `start_date` ### Description Sets the user's start date. ### Method `start_date(value: SlackDate) -> &mut Self` ## `reset_start_date` ### Description Resets the user's start date. ### Method `reset_start_date() -> &mut Self` ## `mopt_start_date` ### Description Optionally sets the user's start date. ### Method `mopt_start_date(value: Option) -> &mut Self` ## `with_start_date` ### Description Sets the user's start date and returns the modified struct. ### Method `with_start_date(value: SlackDate) -> Self` ## `without_start_date` ### Description Removes the user's start date and returns the modified struct. ### Method `without_start_date() -> Self` ## `opt_start_date` ### Description Optionally sets the user's start date and returns the modified struct. ### Method `opt_start_date(value: Option) -> Self ``` -------------------------------- ### Get Last Element Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `last` to get an immutable reference to the last element of a slice. Returns `None` if the slice is empty. ```rust let v = [10, 40, 30]; assert_eq!(Some(&30), v.last()); let w: &[i32] = &[]; assert_eq!(None, w.last()); ``` -------------------------------- ### Implement From for SlackBasicUserInfo Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackBasicUserInfoInit.html Provides a conversion from SlackBasicUserInfoInit to SlackBasicUserInfo. Use this when you have a SlackBasicUserInfoInit and need to obtain a SlackBasicUserInfo. ```rust impl From for SlackBasicUserInfo Source§ #### fn from(value: SlackBasicUserInfoInit) -> Self ``` -------------------------------- ### new Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClient.html Creates a new instance of SlackClient. ```APIDOC ## new ### Description Creates a new instance of SlackClient. ### Method `new` ### Parameters #### Arguments - **http_connector** (`SCHC`) - Required - The HTTP connector to use for Slack API requests. ``` -------------------------------- ### Getting HashMap Length Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SLACK_TIERS_DEFAULT_LIMITS_MAP.html Shows how to get the number of elements currently in a HashMap. The `len()` method returns the count of key-value pairs. ```rust use std::collections::HashMap; let mut a = HashMap::new(); assert_eq!(a.len(), 0); a.insert(1, "a"); assert_eq!(a.len(), 1); ``` -------------------------------- ### Convert from SlackStarsItemChannelInit Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackStarsItemChannel.html Converts a SlackStarsItemChannelInit into a SlackStarsItemChannel. ```rust fn from(value: SlackStarsItemChannelInit) -> Self ``` -------------------------------- ### Getting Value or Default with unwrap_or Source: https://docs.rs/slack-morphism/latest/slack_morphism/type.ClientResult.html Use `unwrap_or` to get the `Ok` value or a provided default if the `Result` is `Err`. Arguments are eagerly evaluated. ```rust let default = 2; let x: Result = Ok(9); assert_eq!(x.unwrap_or(default), 9); let x: Result = Err("error"); assert_eq!(x.unwrap_or(default), default); ``` -------------------------------- ### Safely Get Element or Sub-slice Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html The `get` method returns an `Option` containing a reference to an element or sub-slice. It returns `None` if the index is out of bounds. ```rust let v = [10, 40, 30]; assert_eq!(Some(&40), v.get(1)); assert_eq!(Some(&[10, 40][..]), v.get(0..2)); assert_eq!(None, v.get(3)); assert_eq!(None, v.get(0..4)); ``` -------------------------------- ### From for SlackUser Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackUserInit.html Provides a conversion from SlackUserInit to SlackUser. ```APIDOC ## Trait Implementations ### impl From for SlackUser #### fn from(value: SlackUserInit) -> Self Converts to this type from the input type. ``` -------------------------------- ### Creating SlackBasicTeamInfo with Domain Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackBasicTeamInfo.html Creates a new SlackBasicTeamInfo instance, consuming the current one and setting the domain. ```rust pub fn with_domain(self, value: String) -> Self> ``` -------------------------------- ### Get Last Element Mutably Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `last_mut` to get a mutable reference to the last element of a slice. Returns `None` if the slice is empty. ```rust let x = &mut [0, 1, 2]; if let Some(last) = x.last_mut() { *last = 10; } assert_eq!(x, &[0, 1, 10]); let y: &mut [i32] = &mut []; assert_eq!(None, y.last_mut()); ``` -------------------------------- ### HTTP GET Request with Full URI Source: https://docs.rs/slack-morphism/latest/slack_morphism/trait.SlackClientHttpConnector.html Use this method to perform an HTTP GET request to a fully specified URI. It requires a Url and a SlackClientApiCallContext. ```rust fn http_get_uri<'a, RS>( &'a self, full_uri: Url, context: SlackClientApiCallContext<'a>, ) -> BoxFuture<'a, ClientResult> where RS: for<'de> Deserialize<'de> + Send + 'a; ``` -------------------------------- ### Convert SlackAppManifestMetadataInit to SlackAppManifestMetadata Source: https://docs.rs/slack-morphism/latest/slack_morphism/apps/manifest/struct.SlackAppManifestMetadataInit.html Demonstrates the conversion from SlackAppManifestMetadataInit to SlackAppManifestMetadata using the `from` function. This is useful when you need to create a full manifest from an initial configuration. ```rust fn from(value: SlackAppManifestMetadataInit) -> Self ``` -------------------------------- ### SlackStarsItemFile New Function Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackStarsItemFile.html Constructor for creating a new SlackStarsItemFile instance. ```APIDOC ### impl SlackStarsItemFile #### pub fn new( file: SlackFile, channel: SlackChannelId, date_create: SlackDateTime, ) -> Self Creates a new `SlackStarsItemFile`. ``` -------------------------------- ### Get Last Chunk Immutably Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `last_chunk` to get an immutable reference to the last `N` items of a slice as an array. Returns `None` if the slice is shorter than `N`. ```rust let u = [10, 40, 30]; assert_eq!(Some(&[40, 30]), u.last_chunk::<2>()); let v: &[i32] = &[10]; assert_eq!(None, v.last_chunk::<2>()); let w: &[i32] = &[]; assert_eq!(Some(&[]), w.last_chunk::<0>()); ``` -------------------------------- ### Get First Chunk Mutably Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `first_chunk_mut` to get a mutable reference to the first `N` items of a slice as an array. Returns `None` if the slice is shorter than `N`. ```rust let x = &mut [0, 1, 2]; if let Some(first) = x.first_chunk_mut::<2>() { first[0] = 5; first[1] = 4; } assert_eq!(x, &[5, 4, 2]); assert_eq!(None, x.first_chunk_mut::<4>()); ``` -------------------------------- ### From for SlackStarsItemChannel Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackStarsItemChannelInit.html Implementation of the From trait to convert SlackStarsItemChannelInit into SlackStarsItemChannel. ```APIDOC ## Trait Implementations ### impl From for SlackStarsItemChannel #### fn from(value: SlackStarsItemChannelInit) -> Self Converts to this type from the input type. ``` -------------------------------- ### Implement From for SlackFileBlock Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackFileBlockInit.html Provides a conversion from SlackFileBlockInit to SlackFileBlock. ```rust impl From for SlackFileBlock { fn from(value: SlackFileBlockInit) -> Self { // ... implementation details ... } } ``` -------------------------------- ### Get First Chunk Immutably Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `first_chunk` to get an immutable reference to the first `N` items of a slice as an array. Returns `None` if the slice is shorter than `N`. ```rust let u = [10, 40, 30]; assert_eq!(Some(&[10, 40]), u.first_chunk::<2>()); let v: &[i32] = &[10]; assert_eq!(None, v.first_chunk::<2>()); let w: &[i32] = &[]; assert_eq!(Some(&[]), w.first_chunk::<0>()); ``` -------------------------------- ### Get Mutable Reference to Last N Elements Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `last_chunk_mut` to get a mutable reference to the last N elements of a slice. Returns `None` if the slice is shorter than N. ```rust let x = &mut [0, 1, 2]; if let Some(last) = x.last_chunk_mut::<2>() { last[0] = 10; last[1] = 20; } assert_eq!(x, &[0, 10, 20]); assert_eq!(None, x.last_chunk_mut::<4>()); ``` -------------------------------- ### SlackAppManifestFeaturesSlashCommand::new Source: https://docs.rs/slack-morphism/latest/slack_morphism/apps/struct.SlackAppManifestFeaturesSlashCommand.html Constructor for creating a new SlackAppManifestFeaturesSlashCommand instance. Requires the command name and description. ```APIDOC ## pub fn new(command: String, description: String) -> Self ### Description Creates a new instance of `SlackAppManifestFeaturesSlashCommand` with the provided command and description. ### Parameters - `command`: String - The name of the slash command. - `description`: String - A description of the command. ``` -------------------------------- ### Getting a Mutable Reference to the First Element Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Shows how to get a mutable reference to the first element of a slice using `first_mut()`. Returns `Some(&mut T)` if the slice is not empty, otherwise `None`. ```rust let x = &mut [0, 1, 2]; if let Some(first) = x.first_mut() { *first = 5; } assert_eq!(x, &[5, 1, 2]); let y: &mut [i32] = &mut []; assert_eq!(None, y.first_mut()); ``` -------------------------------- ### SlackStarsItemFile Constructor and Setters Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackStarsItemFile.html Provides methods to create and modify SlackStarsItemFile instances. ```APIDOC ## impl SlackStarsItemFile ### Constructor #### `pub fn new(file: SlackFile, channel: SlackChannelId, date_create: SlackDateTime) -> Self` Creates a new `SlackStarsItemFile`. ### Setter Methods #### `pub fn file(&mut self, value: SlackFile) -> &mut Self` Sets the `file` field. #### `pub fn with_file(self, value: SlackFile) -> Self` Creates a new `SlackStarsItemFile` with the `file` field set. #### `pub fn channel(&mut self, value: SlackChannelId) -> &mut Self` Sets the `channel` field. #### `pub fn with_channel(self, value: SlackChannelId) -> Self` Creates a new `SlackStarsItemFile` with the `channel` field set. #### `pub fn date_create(&mut self, value: SlackDateTime) -> &mut Self` Sets the `date_create` field. #### `pub fn with_date_create(self, value: SlackDateTime) -> Self` Creates a new `SlackStarsItemFile` with the `date_create` field set. ``` -------------------------------- ### SlackFile Construction and Field Setting Source: https://docs.rs/slack-morphism/latest/slack_morphism/files/struct.SlackFile.html Demonstrates how to construct a SlackFile and set its fields using builder-style methods. ```APIDOC ## SlackFile Methods ### `new(id: SlackFileId, flags: SlackFileFlags) -> Self` Creates a new SlackFile instance. ### Field Setters (mutable) These methods allow modifying fields of an existing SlackFile instance. - `id(&mut self, value: SlackFileId) -> &mut Self` - `created(&mut self, value: SlackDateTime) -> &mut Self` - `reset_created(&mut self) -> &mut Self` - `mopt_created(&mut self, value: Option) -> &mut Self` - `timestamp(&mut self, value: SlackDateTime) -> &mut Self` - `reset_timestamp(&mut self) -> &mut Self` - `mopt_timestamp(&mut self, value: Option) -> &mut Self` - `name(&mut self, value: String) -> &mut Self` - `reset_name(&mut self) -> &mut Self` - `mopt_name(&mut self, value: Option) -> &mut Self` - `title(&mut self, value: String) -> &mut Self` - `reset_title(&mut self) -> &mut Self` - `mopt_title(&mut self, value: Option) -> &mut Self` - `mimetype(&mut self, value: SlackMimeType) -> &mut Self` - `reset_mimetype(&mut self) -> &mut Self` - `mopt_mimetype(&mut self, value: Option) -> &mut Self` - `filetype(&mut self, value: SlackFileType) -> &mut Self` - `reset_filetype(&mut self) -> &mut Self` - `mopt_filetype(&mut self, value: Option) -> &mut Self` - `pretty_type(&mut self, value: SlackFilePrettyType) -> &mut Self` - `reset_pretty_type(&mut self) -> &mut Self` - `mopt_pretty_type(&mut self, value: Option) -> &mut Self` - `external_type(&mut self, value: SlackFileExternalType) -> &mut Self` - `reset_external_type(&mut self) -> &mut Self` - `mopt_external_type(&mut self, value: Option) -> &mut Self` ### Field Setters (consuming) These methods consume the SlackFile instance and return a new instance with the updated field. - `with_id(self, value: SlackFileId) -> Self` - `with_created(self, value: SlackDateTime) -> Self` - `without_created(self) -> Self` - `opt_created(self, value: Option) -> Self` - `with_timestamp(self, value: SlackDateTime) -> Self` - `without_timestamp(self) -> Self` - `opt_timestamp(self, value: Option) -> Self` - `with_name(self, value: String) -> Self` - `without_name(self) -> Self` - `opt_name(self, value: Option) -> Self` - `with_title(self, value: String) -> Self` - `without_title(self) -> Self` - `opt_title(self, value: Option) -> Self` - `with_mimetype(self, value: SlackMimeType) -> Self` - `without_mimetype(self) -> Self` - `opt_mimetype(self, value: Option) -> Self` - `with_filetype(self, value: SlackFileType) -> Self` - `without_filetype(self) -> Self` - `opt_filetype(self, value: Option) -> Self` - `with_pretty_type(self, value: SlackFilePrettyType) -> Self` - `without_pretty_type(self) -> Self` - `opt_pretty_type(self, value: Option) -> Self` - `with_external_type(self, value: SlackFileExternalType) -> Self` - `without_external_type(self) -> Self` ``` -------------------------------- ### HTTP GET Request with Relative URI and Parameters Source: https://docs.rs/slack-morphism/latest/slack_morphism/trait.SlackClientHttpConnector.html Use this provided method to perform an HTTP GET request using a method-relative URI and query parameters. It constructs the full URI internally. ```rust fn http_get<'a, 'p, RS, PT, TS>( &'a self, method_relative_uri: &str, params: &'p PT, context: SlackClientApiCallContext<'a>, ) -> BoxFuture<'a, ClientResult> where RS: for<'de> Deserialize<'de> + Send + 'a, PT: IntoIterator)> + Clone, TS: AsRef + 'p + Send { ... } ``` -------------------------------- ### HTTP GET Request with Client Secret Source: https://docs.rs/slack-morphism/latest/slack_morphism/trait.SlackClientHttpConnector.html Use this method for HTTP GET requests that require a client ID and client secret for authentication. It takes a full URI, client ID, and client secret. ```rust fn http_get_with_client_secret<'a, RS>( &'a self, full_uri: Url, client_id: &'a SlackClientId, client_secret: &'a SlackClientSecret, ) -> BoxFuture<'a, ClientResult> where RS: for<'de> Deserialize<'de> + Send + 'a; ``` -------------------------------- ### Create SlackBasicUserInfo Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackBasicUserInfo.html Initializes a new SlackBasicUserInfo instance with a mandatory user ID. ```rust pub fn new(id: SlackUserId) -> Self> ``` -------------------------------- ### users.getPresence Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientSession.html Gets the presence of a user. ```APIDOC ## users.getPresence ### Description Gets the presence of a user. ### Method GET ### Endpoint https://api.slack.com/methods/users.getPresence ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **req** (SlackApiUsersGetPresenceRequest) - Required - The request object containing parameters for the users.getPresence API call. ### Request Example ```json { "example": "request body for users.getPresence" } ``` ### Response #### Success Response (200) - **presence** (string) - The presence of the user. #### Response Example ```json { "example": "response body for users.getPresence" } ``` ``` -------------------------------- ### Create SlackApiChatUnfurlMapItemV2 with optional preview Source: https://docs.rs/slack-morphism/latest/slack_morphism/api/struct.SlackApiChatUnfurlMapItemV2.html Use `opt_preview` for an immutable way to set an optional preview. ```rust pub fn opt_preview(self, value: Option) -> Self ``` -------------------------------- ### team.info Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientSession.html Gets information about a workspace. ```APIDOC ## team.info ### Description Gets information about a workspace. ### Method GET ### Endpoint https://api.slack.com/methods/team.info ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **req** (SlackApiTeamInfoRequest) - Required - The request object containing parameters for the team.info API call. ### Request Example ```json { "example": "request body for team.info" } ``` ### Response #### Success Response (200) - **team** (object) - Description of the team object #### Response Example ```json { "example": "response body for team.info" } ``` ``` -------------------------------- ### SlackBotInfo::new Constructor Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackBotInfo.html Creates a new SlackBotInfo instance with the required name and app_id. ```rust pub fn new(name: String, app_id: String) -> Self ``` -------------------------------- ### TypeId Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/apps/struct.SlackAppManifest.html Gets the `TypeId` of the struct. ```APIDOC ## fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ``` -------------------------------- ### SlackApiChatUnfurlRequest Initialization Source: https://docs.rs/slack-morphism/latest/slack_morphism/api/struct.SlackApiChatUnfurlRequest.html Demonstrates how to create a new SlackApiChatUnfurlRequest using the `new` constructor and its associated builder methods. ```APIDOC ## Struct SlackApiChatUnfurlRequest ### Description Represents a request to unfurl a message in Slack. ### Fields - `channel` (SlackChannelId) - Required - The channel ID where the message is located. - `ts` (SlackTs) - Required - The timestamp of the message to unfurl. - `unfurls` (HashMap) - Required - A map of URLs to unfurl information. - `user_auth_message` (Option) - Optional - A message to display to the user for authentication. - `user_auth_required` (Option) - Optional - Whether user authentication is required. - `user_auth_url` (Option) - Optional - The URL for user authentication. ### Methods #### Constructor - `new(channel: SlackChannelId, ts: SlackTs, unfurls: HashMap) -> Self` Creates a new SlackApiChatUnfurlRequest. #### Builder Methods - `channel(value: SlackChannelId) -> &mut Self` Sets the channel ID. - `with_channel(value: SlackChannelId) -> Self` Sets the channel ID and returns the modified request. - `ts(value: SlackTs) -> &mut Self` Sets the message timestamp. - `with_ts(value: SlackTs) -> Self` Sets the message timestamp and returns the modified request. - `unfurls(value: HashMap) -> &mut Self` Sets the unfurls map. - `with_unfurls(value: HashMap) -> Self` Sets the unfurls map and returns the modified request. - `user_auth_message(value: String) -> &mut Self` Sets the user authentication message. - `reset_user_auth_message(&mut self) -> &mut Self` Resets the user authentication message. - `mopt_user_auth_message(value: Option) -> &mut Self` Sets the optional user authentication message. - `with_user_auth_message(value: String) -> Self` Sets the user authentication message and returns the modified request. - `without_user_auth_message(self) -> Self` Removes the user authentication message. - `opt_user_auth_message(value: Option) -> Self` Sets the optional user authentication message and returns the modified request. - `user_auth_required(value: bool) -> &mut Self` Sets whether user authentication is required. - `reset_user_auth_required(&mut self) -> &mut Self` Resets the user authentication required flag. - `mopt_user_auth_required(value: Option) -> &mut Self` Sets the optional user authentication required flag. - `with_user_auth_required(value: bool) -> Self` Sets whether user authentication is required and returns the modified request. - `without_user_auth_required(self) -> Self` Removes the user authentication required flag. - `opt_user_auth_required(value: Option) -> Self` Sets the optional user authentication required flag and returns the modified request. - `user_auth_url(value: Url) -> &mut Self` Sets the user authentication URL. - `reset_user_auth_url(&mut self) -> &mut Self` Resets the user authentication URL. - `mopt_user_auth_url(value: Option) -> &mut Self` Sets the optional user authentication URL. - `with_user_auth_url(value: Url) -> Self` Sets the user authentication URL and returns the modified request. - `without_user_auth_url(self) -> Self` Removes the user authentication URL. - `opt_user_auth_url(value: Option) -> Self` Sets the optional user authentication URL and returns the modified request. ### Request Example ```json { "channel": "C1234567890", "ts": "1678886400.123456", "unfurls": { "https://example.com": { "title": "Example Domain", "title_link": "https://example.com", "text": "This is an example domain." } }, "user_auth_message": "Please authenticate to view this content.", "user_auth_required": true, "user_auth_url": "https://auth.example.com" } ``` ### Response Example (Success response details are not provided in the source.) ### Error Handling (Error handling details are not provided in the source.) ``` -------------------------------- ### SlackPin::new Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackPin.html Creates a new instance of SlackPin. ```APIDOC ## impl SlackPin ### pub fn new(channel: SlackChannelId, created: SlackDateTime, created_by: SlackUserId) -> Self Creates a new `SlackPin` with the provided channel, creation timestamp, and creator ID. ``` -------------------------------- ### TypeId Source: https://docs.rs/slack-morphism/latest/slack_morphism/events/struct.SlackInteractionActionMessageAttachmentContainer.html Gets the `TypeId` of the container. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ``` -------------------------------- ### Get Mutable Raw Pointer to Slice Buffer Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Use `as_mut_ptr` to get an unsafe mutable pointer to the slice's buffer. The caller must ensure the slice outlives the pointer and manage potential reallocation issues. ```rust let x = &mut [1, 2, 4]; let x_ptr = x.as_mut_ptr(); unsafe { for i in 0..x.len() { *x_ptr.add(i) += 2; } } assert_eq!(x, &[3, 4, 6]); ``` -------------------------------- ### From for SlackApiChatUnfurlMapItemV2 Source: https://docs.rs/slack-morphism/latest/slack_morphism/api/struct.SlackApiChatUnfurlMapItemV2Init.html Provides a conversion from SlackApiChatUnfurlMapItemV2Init to SlackApiChatUnfurlMapItemV2. ```APIDOC ### impl From for SlackApiChatUnfurlMapItemV2 #### fn from(value: SlackApiChatUnfurlMapItemV2Init) -> Self Converts to this type from the input type. ``` -------------------------------- ### SlackViewState::new Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/blocks/struct.SlackViewState.html Constructs a new SlackViewState instance. ```APIDOC ### `impl SlackViewState` #### `pub fn new(values: HashMap>) -> Self` Constructs a new `SlackViewState` with the provided values. ``` -------------------------------- ### Rust Slice chunks_mut() Example Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SLACK_HTTP_EMPTY_GET_PARAMS.html Provides an example of creating mutable, non-overlapping chunks from a slice. Each chunk is a mutable slice, allowing in-place modification. The last chunk may be smaller than `chunk_size`. Panics if `chunk_size` is zero. ```rust let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; for chunk in v.chunks_mut(2) { for elem in chunk.iter_mut() { *elem += count; } count += 1; } assert_eq!(v, &[1, 1, 2, 2, 3]); ``` -------------------------------- ### users.identity Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientSession.html Gets the identity of the current user. ```APIDOC ## users.identity ### Description Gets the identity of the current user. ### Method GET ### Endpoint https://api.slack.com/methods/users.identity ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body for users.identity" } ``` ### Response #### Success Response (200) - **user** (object) - Description of the user object - **team** (object) - Description of the team object #### Response Example ```json { "example": "response body for users.identity" } ``` ``` -------------------------------- ### Create SlackAppManifestSettings with event subscriptions Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/apps/struct.SlackAppManifestSettings.html Creates a new SlackAppManifestSettings instance and sets the event subscriptions. This method consumes the current instance. ```rust pub fn with_event_subscriptions( self, value: SlackAppManifestSettingsEventSubscriptions, ) -> Self> ``` -------------------------------- ### team.profile.get Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientSession.html Gets the profile information for a workspace. ```APIDOC ## team.profile.get ### Description Gets the profile information for a workspace. ### Method GET ### Endpoint https://api.slack.com/methods/team.profile.get ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **req** (SlackApiTeamProfileGetRequest) - Required - The request object containing parameters for the team.profile.get API call. ### Request Example ```json { "example": "request body for team.profile.get" } ``` ### Response #### Success Response (200) - **profile** (object) - Description of the profile object #### Response Example ```json { "example": "response body for team.profile.get" } ``` ``` -------------------------------- ### Initialize SlackAppCredentials Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackAppCredentials.html Constructs a new SlackAppCredentials instance with all required fields. Ensure all provided values are correct for your Slack application. ```rust pub fn new( client_id: SlackClientId, client_secret: SlackClientSecret, verification_token: SlackVerificationToken, signing_secret: SlackSigningSecret, ) -> Self ``` -------------------------------- ### SlackHomeView Construction Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackHomeView.html Demonstrates how to create a new SlackHomeView with initial blocks. ```APIDOC ## new ### Description Creates a new `SlackHomeView` with the provided blocks. ### Method `pub fn new(blocks: Vec) -> Self` ### Parameters * `blocks` (Vec) - The blocks to include in the view. ``` -------------------------------- ### reactions.get Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientSession.html Gets information about reactions to a message. ```APIDOC ## reactions.get ### Description Gets information about reactions to a message. ### Method GET ### Endpoint https://api.slack.com/methods/reactions.get ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **req** (SlackApiReactionsGetRequest) - Required - The request object containing parameters for the reactions.get API call. ### Request Example ```json { "example": "request body for reactions.get" } ``` ### Response #### Success Response (200) - **items** (array) - Description of the items array - **message** (object) - Description of the message object - **response_metadata** (object) - Description of the response_metadata object #### Response Example ```json { "example": "response body for reactions.get" } ``` ``` -------------------------------- ### SlackBlockSuggestionOptionsInit Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/events/struct.SlackBlockSuggestionOptionsInit.html Represents the initialization structure for Slack block suggestion options, containing a list of choices. ```APIDOC ## Struct SlackBlockSuggestionOptionsInit ### Summary ```rust pub struct SlackBlockSuggestionOptionsInit { pub options: Vec>, } ``` ### Fields * `options`: `Vec>` - A vector of Slack block choice items, where each item is a plain text option. ``` -------------------------------- ### files.getUploadURLExternal Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientSession.html Gets an external upload URL. ```APIDOC ## files.getUploadURLExternal ### Description Gets an external upload URL. ### Method POST ### Endpoint https://api.slack.com/methods/files.getUploadURLExternal ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **req** (SlackApiFilesGetUploadUrlExternalRequest) - Required - The request object containing parameters for the files.getUploadURLExternal API call. ### Request Example ```json { "example": "request body for files.getUploadURLExternal" } ``` ### Response #### Success Response (200) - **upload_url** (string) - The upload URL. - **file_id** (string) - The ID of the file. #### Response Example ```json { "example": "response body for files.getUploadURLExternal" } ``` ``` -------------------------------- ### type_id Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackInteractionActionInfo.html Gets the TypeId of the SlackInteractionActionInfo struct. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Returns The `TypeId` of the struct. ``` -------------------------------- ### From for SlackAppManifestSettingsEventSubscriptions Source: https://docs.rs/slack-morphism/latest/slack_morphism/manifest/struct.SlackAppManifestSettingsEventSubscriptionsInit.html Demonstrates the conversion from SlackAppManifestSettingsEventSubscriptionsInit to SlackAppManifestSettingsEventSubscriptions. ```APIDOC ## Trait Implementation: From for SlackAppManifestSettingsEventSubscriptions ### fn from(value: SlackAppManifestSettingsEventSubscriptionsInit) -> Self Converts `SlackAppManifestSettingsEventSubscriptionsInit` into `SlackAppManifestSettingsEventSubscriptions`. ``` -------------------------------- ### action_id Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackBlockUsersSelectElement.html Sets or gets the action_id for the SlackBlockUsersSelectElement. ```APIDOC ## pub fn action_id(&mut self, value: SlackActionId) -> &mut Self Sets the action ID for the element. ``` ```APIDOC ## pub fn with_action_id(self, value: SlackActionId) -> Self Consumes the element and returns a new one with the action ID set. ``` -------------------------------- ### From for SlackAppManifestMetadata Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/manifest/struct.SlackAppManifestMetadataInit.html Demonstrates the conversion from SlackAppManifestMetadataInit to SlackAppManifestMetadata, allowing for the creation of a SlackAppManifestMetadata instance from the initialization struct. ```APIDOC ## Trait Implementations ### impl From for SlackAppManifestMetadata #### fn from(value: SlackAppManifestMetadataInit) -> Self Converts to this type from the input type. This allows creating a `SlackAppManifestMetadata` from a `SlackAppManifestMetadataInit`. ``` -------------------------------- ### type_id Source: https://docs.rs/slack-morphism/latest/slack_morphism/manifest/struct.SlackAppManifest.html Gets the `TypeId` of the struct instance. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Returns `TypeId` ``` -------------------------------- ### Create SlackAppManifestSettings with organization deployment enabled Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/apps/struct.SlackAppManifestSettings.html Creates a new SlackAppManifestSettings instance and enables organization deployment. This method consumes the current instance. ```rust pub fn with_org_deploy_enabled(self, value: bool) -> Self> ``` -------------------------------- ### SlackAssistantPrompt::new Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackAssistantPrompt.html Creates a new instance of SlackAssistantPrompt. ```APIDOC ## SlackAssistantPrompt::new ### Description Creates a new instance of `SlackAssistantPrompt` with the given title and message. ### Signature ```rust pub fn new(title: String, message: String) -> Self ``` ``` -------------------------------- ### HTTP GET Request with Relative URI Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackClientHttpSessionApi.html Performs an HTTP GET request to a Slack API method using its relative URI. This is the standard way to call Slack API methods. It accepts parameters and optional rate control configuration. ```rust pub async fn http_get<'p, RS, PT, TS>( &self, method_relative_uri: &str, params: &'p PT, rate_control_params: Option<&'a SlackApiMethodRateControlConfig>, ) -> ClientResult where RS: for<'de> Deserialize<'de> + Send, PT: IntoIterator)> + Clone, TS: AsRef + 'p + Send, ``` -------------------------------- ### Implement From for SlackStarsItemGroup Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackStarsItemGroup.html Provides a conversion from SlackStarsItemGroupInit to SlackStarsItemGroup. ```rust fn from(value: SlackStarsItemGroupInit) -> Self ``` -------------------------------- ### SlackAppManifest::new Source: https://docs.rs/slack-morphism/latest/slack_morphism/manifest/struct.SlackAppManifest.html Creates a new SlackAppManifest with the required display information. ```APIDOC ## `new` Function ### Description Creates a new `SlackAppManifest` instance, requiring `display_information`. ### Signature ```rust pub fn new(display_information: SlackAppManifestDisplayInformation) -> Self ``` ``` -------------------------------- ### SlackClientSocketModeListener::start Source: https://docs.rs/slack-morphism/latest/slack_morphism/socket_mode/struct.SlackClientSocketModeListener.html Starts the SlackClientSocketModeListener. This is an asynchronous operation. ```rust pub async fn start(&self) ``` -------------------------------- ### Create Slack Client Instance Source: https://docs.rs/slack-morphism/latest/slack_morphism/index.html Instantiate a Slack client using the Hyper connector. This is the first step to interacting with the Slack API. ```rust use slack_morphism::prelude::*; let client = SlackClient::new(SlackClientHyperConnector::new()); ``` -------------------------------- ### SlackTs::type_id Source: https://docs.rs/slack-morphism/latest/slack_morphism/struct.SlackTs.html Gets the TypeId of the SlackTs value. ```APIDOC ## SlackTs::type_id ### Description Gets the `TypeId` of `self`. ### Signature `fn type_id(&self) -> TypeId` ``` -------------------------------- ### SlackAppManifestFeaturesSlashCommand Constructor and Methods Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/manifest/struct.SlackAppManifestFeaturesSlashCommand.html Provides methods for creating and configuring SlackAppManifestFeaturesSlashCommand instances. ```APIDOC ## Implementations for SlackAppManifestFeaturesSlashCommand ### Constructor * `new(command: String, description: String) -> Self`: Creates a new `SlackAppManifestFeaturesSlashCommand` with the required command and description. ### Setter Methods (Mutable) * `command(&mut self, value: String) -> &mut Self`: Sets the command name. * `description(&mut self, value: String) -> &mut Self`: Sets the command description. * `should_escape(&mut self, value: bool) -> &mut Self`: Sets the `should_escape` option. * `reset_should_escape(&mut self) -> &mut Self`: Resets the `should_escape` option to its default. * `mopt_should_escape(&mut self, value: Option) -> &mut Self`: Sets the `should_escape` option with an optional value. * `url(&mut self, value: Url) -> &mut Self`: Sets the command URL. * `reset_url(&mut self) -> &mut Self`: Resets the `url` option to its default. * `mopt_url(&mut self, value: Option) -> &mut Self`: Sets the `url` option with an optional value. * `usage_hint(&mut self, value: String) -> &mut Self`: Sets the usage hint for the command. * `reset_usage_hint(&mut self) -> &mut Self`: Resets the `usage_hint` option to its default. * `mopt_usage_hint(&mut self, value: Option) -> &mut Self`: Sets the `usage_hint` option with an optional value. ### Setter Methods (Immutable/Builder Style) * `with_command(self, value: String) -> Self`: Returns a new instance with the command name set. * `with_description(self, value: String) -> Self`: Returns a new instance with the description set. * `with_should_escape(self, value: bool) -> Self`: Returns a new instance with the `should_escape` option set. * `without_should_escape(self) -> Self`: Returns a new instance with the `should_escape` option unset. * `opt_should_escape(self, value: Option) -> Self`: Returns a new instance with the `should_escape` option set to an optional value. * `with_url(self, value: Url) -> Self`: Returns a new instance with the URL set. * `without_url(self) -> Self`: Returns a new instance with the URL unset. * `opt_url(self, value: Option) -> Self`: Returns a new instance with the URL set to an optional value. * `with_usage_hint(self, value: String) -> Self`: Returns a new instance with the usage hint set. * `without_usage_hint(self) -> Self`: Returns a new instance with the usage hint unset. * `opt_usage_hint(self, value: Option) -> Self`: Returns a new instance with the usage hint set to an optional value. ``` -------------------------------- ### SlackRichTextDate::style Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackRichTextDate.html Sets or gets the style for the SlackRichTextDate. ```APIDOC ### pub fn style(&mut self, value: SlackRichTextStyle) -> &mut Self Sets the style for the SlackRichTextDate. ### pub fn reset_style(&mut self) -> &mut Self Resets the style for the SlackRichTextDate. ### pub fn mopt_style(&mut self, value: Option) -> &mut Self Sets the style for the SlackRichTextDate, accepting an Option. ### pub fn with_style(self, value: SlackRichTextStyle) -> Self Returns a new SlackRichTextDate with the style set. ### pub fn without_style(self) -> Self Returns a new SlackRichTextDate with the style removed. ### pub fn opt_style(self, value: Option) -> Self Returns a new SlackRichTextDate with the style set, accepting an Option. ``` -------------------------------- ### Constructor: new Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/events/struct.SlackBlockSuggestionOptionGroups.html Creates a new instance of `SlackBlockSuggestionOptionGroups` with the provided option groups. ```APIDOC ### `new` Constructor ```rust pub fn new(option_groups: Vec>) -> Self ``` Creates a new `SlackBlockSuggestionOptionGroups` instance. ``` -------------------------------- ### SlackRichTextDate::timestamp Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackRichTextDate.html Sets or gets the timestamp for the SlackRichTextDate. ```APIDOC ### pub fn timestamp(&mut self, value: SlackDateTime) -> &mut Self Sets the timestamp for the SlackRichTextDate. ### pub fn with_timestamp(self, value: SlackDateTime) -> Self Returns a new SlackRichTextDate with the timestamp set. ``` -------------------------------- ### confirm Source: https://docs.rs/slack-morphism/latest/slack_morphism/prelude/struct.SlackBlockUsersSelectElement.html Sets or gets the confirmation dialog for the SlackBlockUsersSelectElement. ```APIDOC ## pub fn confirm(&mut self, value: SlackBlockConfirmItem) -> &mut Self Sets the confirmation dialog for the element. ``` ```APIDOC ## pub fn reset_confirm(&mut self) -> &mut Self Resets the confirmation dialog to its default value. ``` ```APIDOC ## pub fn mopt_confirm(&mut self, value: Option) -> &mut Self Sets the confirmation dialog, allowing `None`. ``` ```APIDOC ## pub fn with_confirm(self, value: SlackBlockConfirmItem) -> Self Consumes the element and returns a new one with the confirmation dialog set. ``` ```APIDOC ## pub fn without_confirm(self) -> Self Consumes the element and returns a new one with the confirmation dialog removed. ``` ```APIDOC ## pub fn opt_confirm(self, value: Option) -> Self Consumes the element and returns a new one with the optional confirmation dialog set. ```