Bayonets are used to attach lenses to the camera body and some types of compacts. In addition to the mechanical coupling, the bayonet ensures communication between the camera and lens due to the fixed attachment being made of metal. Types depend on the brand of the lens, with each manufacturer offering its own mounting system.