pub fn add_api_mapping(&self, path: String) -> Result<(), Error> {
		match &self.http_context {
			Some(http_context) => {
				let mut context = http_context.write().map_err(|e| {
					let error: Error =
						ErrorKind::PoisonError(format!("unexpected error: {}", e.to_string()))
							.into();
					error
				})?;
				context.api_mappings.insert(path);
			}
			None => {
				return Err(ErrorKind::SetupError(
					"Context not set, must call start first.".to_string(),
				)
				.into());
			}
		}

		Ok(())
	}
/// Add an API mapping such that any requests that have this URI will be sent to the specified
/// [`HttpConfig::callback`] instead of being processed by the [`HttpServer`]. This is used
/// by rustlet mappings.
Add an API mapping such that any requests that have this URI will be sent to the specified
[`HttpConfig::callback`] instead of being processed by the [`HttpServer`]. This is used
by rustlet mappings.
Add an API mapping such that any requests that have this URI will be sent to the specified [ ` HttpConfig :: callback ` ] instead of being processed by the [ ` HttpServer ` ] . This is used by rustlet mappings .
pub fn add_api_mapping(&self, path: String) -> Result<(), Error> {
		match &self.http_context {
			Some(http_context) => {
				let mut context = http_context.write().map_err(|e| {
					let error: Error =
						ErrorKind::PoisonError(format!("unexpected error: {}", e.to_string()))
							.into();
					error
				})?;
				context.api_mappings.insert(path);
			}
			None => {
				return Err(ErrorKind::SetupError(
					"Context not set, must call start first.".to_string(),
				)
				.into());
			}
		}
		Ok(())
	}
pub fn add_api_mapping ( & self , path : String ) -> Result < ( ) , Error > { match & self . http_context { Some ( http_context ) => { let mut context = http_context . write ( ) . map_err ( | e | { let error : Error = ErrorKind :: PoisonError ( format ! ( " " e to_string ( ) ) ) . into ( ) ; error } ) ? ; context . api_mappings . insert ( path ) ; } None => { return Err ( ErrorKind :: SetupError ( " " . to_string ( ) , ) . into ( ) ) ; } } Ok ( ( ) ) }
Add an API mapping such that any requests that have this URI will be sent to the specified
[`HttpConfig::callback`] instead of being processed by the [`HttpServer`].
Add an API mapping such that any requests that have this URI will be sent to the specified [ ` HttpConfig :: callback ` ] instead of being processed by the [ ` HttpServer ` ] .
&self
path
String
&self
path
String