pub struct CIKQuery { /* private fields */ }Expand description
Provides a methods to get short CIKs (no leading zeros) from a ticker represented as string.
Implementations§
Source§impl CIKQuery
impl CIKQuery
Sourcepub fn new(file_path: Option<&str>) -> Result<CIKQuery, EDGARError>
pub fn new(file_path: Option<&str>) -> Result<CIKQuery, EDGARError>
Instantiates CIKQuery with an optionally defined file_path.
If the file path does not exist or the file_path is None, then the default URL is used.
use sec_edgar::edgar_query::cik_query::CIKQuery;
let ticker = Some("amd");
let cik_query = CIKQuery::new(ticker);Sourcepub async fn get_cik(&self, ticker: &str) -> Result<String, EDGARError>
pub async fn get_cik(&self, ticker: &str) -> Result<String, EDGARError>
Returns the short CIK (no leading zeros) either from the default URL or from the file defined when CIKQuery was instantiated.
use sec_edgar::edgar_query::cik_query::CIKQuery;
async fn some_func() {
let ticker = "AMD";
let cik_query = CIKQuery::new(None).unwrap();
// To save yourself a trip, you can define the path to a local file, which should be the same as what is found [here](https://www.sec.gov/include/ticker.txt).
// let cik_query = CIKQuery::new(Some("./your/local/file")).await;
let cik = cik_query.get_cik(ticker).await;
}The ticker is case-insensitive.
Trait Implementations§
impl StructuralPartialEq for CIKQuery
Auto Trait Implementations§
impl Freeze for CIKQuery
impl RefUnwindSafe for CIKQuery
impl Send for CIKQuery
impl Sync for CIKQuery
impl Unpin for CIKQuery
impl UnsafeUnpin for CIKQuery
impl UnwindSafe for CIKQuery
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