A rim is an external flange that is machined, cast, molded, stamped, or pressed around the bottom of a firearms cartridge. Thus, rimmed cartridges are sometimes called "flanged" cartridges. Almost all cartridges feature an extractor or headspacing rim, in spite of the fact that some cartridges are known as "rimless cartridges". The rim may serve a number of purposes, including providing a lip for the extractor to engage, and sometimes serving to headspace the cartridge.